データフレームの列からパターンを抽出しています。一部には「オスカー」という言葉があり、一部には「オスカー」という言葉があります。パンダのデータフレームの抽出方法以下は抽出行コードです。これによりエラーが発生します。Pandasデータフレームの抽出パターン
df['Oscar_Awards_Won'] = df['Awards'].str.extract('Won (\d+) (Oscar[s]?)', expand=True).fillna(0)
サンプルデータを送信していただきありがとうございます。列賞のサンプルデータ。私はオスカーの勝利を引き出すことを試みています。
Awards
Won 3 Oscars. Another 234 wins & 312 nominations.
Won 7 Oscars. Another 215 wins & 169 nominations.
Won 11 Oscars. Another 174 wins & 113 nominations.
Won 4 Oscars. Another 122 wins & 213 nominations.
Won 3 Oscars. Another 92 wins & 150 nominations.
Won 1 Oscar. Another 91 wins & 95 nominations.
私はサンプルデータと予想される出力が必要です。 [*** MCVE ***](http://stackoverflow.com/help/mcve)と[*** HowToAsk ***](http://stackoverflow.com/help/how-to-ask)を読み、 – piRSquared
あなたの質問は、サンプルデータを提供していないため、下落してしまわなかったことは幸運です。 –