LoginSignup
0
0

More than 5 years have passed since last update.

Pandasのデータラングリングの基礎 - 行での条件付きの代入-

Last updated at Posted at 2017-10-22

条件入れて代入していくスタイルdframeの列column_AについてAAと入っているときBBに代入し直す場合

dframe[dframe['column_A'] =='AA']='BB'

追記)
これだとだdatafrmeの書換えなのでミスになる。
dframe.AA[dframe['column_A'] =='AA']='BB'
が正解。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0