I have a column(actually couple of columns) that have mixed kind of data: categorical and numerical data(correspond to different category). However, they should just be categorical in nature. My final goal is to give them a one-hot-encoding representation.
The numerical values are mostly zeros in the column. I want to convert this column to categorical. Since I don't know a direct way(mixed to one-hot-encoding) of converting using get_dummies()
. Therefore, I first converted to numerical completely, then converted to one-hot-encoding.
The image below represents my scenario.
Is there a better approach? Is there a way to directly convert the data to categorical.
Any help is appreciated.