Last active
May 11, 2019 15:11
-
-
Save khuangaf/f8c9ba02294071f699340f3670c6eb1f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.preprocessing import LabelEncoder | |
df = pd.read_csv('../input/yoochoose-click.dat', header=None) | |
df.columns=['session_id','timestamp','item_id','category'] | |
buy_df = pd.read_csv('../input/yoochoose-buys.dat', header=None) | |
buy_df.columns=['session_id','timestamp','item_id','price','quantity'] | |
item_encoder = LabelEncoder() | |
df['item_id'] = item_encoder.fit_transform(df.item_id) | |
df.head() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment