Creating a pandas dataframe from a csv file with 1-hot encoded set of columns
I don't think there's a way to tell pandas that the columns imported are already encoded (whichever it was used already before importing).
The advantage is you don't have to encode again.
The disadvantage is the imported DF treats your encoded columns as new columns rather than encoded values of the same column.
My input csv file is already 1-hot encoded (its exported from another system):




id
vehicle_1(car)
vehicle_1(truck)
vehicle_1(other)




1
0
1
0


2
1
0
0




Is there a way to tell pandas to treat the 'vehicle_' columns a 1-hot encoded? Perhaps during the construction of the dataframe? I'm assuming libraries like seaborn, which can plot data based on categories would need to know to treat the set of columns as 1-hot encoded values.