Skip to content

Instantly share code, notes, and snippets.

@kaeton
Created February 19, 2018 07:26
Show Gist options
  • Save kaeton/a4845dc4a1f1db8cb1679141e18d562d to your computer and use it in GitHub Desktop.
Save kaeton/a4845dc4a1f1db8cb1679141e18d562d to your computer and use it in GitHub Desktop.
ダミー変数を作成する際のpythonコード
import pandas as pd
origin_data = pd.read_csv("使用するデータ.csv")
weekday_dummy = pd.get_dummies(origin_data['曜日'], drop_first = True)
dummy_data = pd.merge(origin_data, weekday_dummy, left_index=True, right_index=True)
dummy_data.to_csv("put_true_dummy_weekday.csv", index=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment