how to encode categorical column in python code example
Example 1: how to convert categorical data to numerical data in python
obj_df["body_style"] = obj_df["body_style"].astype('category')
obj_df.dtypes
Example 2: how to convert categorical data to numerical data in python
pd.get_dummies(obj_df, columns=["body_style", "drive_wheels"], prefix=["body", "drive"]).head()