convert to categorical pandas dataframe code example
Example 1: panda categorical data into numerica
sex = train_dataset['Sex'].replace(['female','male'],[0,1])
print(sex)
Example 2: how to store categorical variables in separate dataframe
df.loc[:,df.dtypes==np.object]