LoginSignup
1
1

More than 3 years have passed since last update.

Pandas - 個人的よく忘れるもの

Last updated at Posted at 2019-08-18

Pandas

個人的に忘れやすいやつをメモしています

カラムの値の変換

df['feature'].replace([list], new)

カラム名の変更

‐ 複数変更の変更
df = df.rename(columns={old1:new1, old2:new2})

カラム削除

df = df.drop([list], axis=1)

カテゴリカルな要素の数値へのマッピング

mapping_dict = {"One":1, "Two":2,...}
df["feature"] = df["feature"]map(mapping_dict)

連続値を分割する

df.feature = pd.cut(df.feature, number)
1
1
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
1
1