LoginSignup
0
0

More than 3 years have passed since last update.

データ分析で役立つPandas DataFrameへの置換操作のやりかた(簡単)

Last updated at Posted at 2021-01-21

pandas でデータ置換を行うときに見る個人メモ。
whereは使いにくいのでもっとわかりやすく書きたかった。

結論

# pandas : data_x
data_x.width = data_x.width.replace('めっちゃ高い', 333)

これで'めっちゃ高い'を333に置き換えることができる。

'pandasのデータ'.'対応する列名'.replace('対象データ', '置換したいデータ')という構造

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