LabelEncoder dataset python code example
Example 1: label encoding
from sklearn.preprocessing import LabelEncoder
le = LabelEncoder()
companydata.ShelveLoc = le.fit_transform(companydata.ShelveLoc)
Example 2: how to convert categorical data to binary data in python
MedInc False
HouseAge False
AveRooms False
AveBedrms False
Population False
AveOccup False
Latitude False
Longitude False
Price False
dtype: bool