I 'am trying to encode a dataframe with LabelEncoder() before creating my machine learning model
here the code :
from sklearn.preprocessing import LabelEncoder
# LabelEncoder
le = LabelEncoder()
# apply "le.fit_transform"
df_encoded = data1.apply(le.fit_transform)
print(df_encoded)
print(le.classes_)
But I got this error :
TypeError: ("'<' not supported between instances of 'str' and 'NoneType'", 'occurred at index SACC_MARKET_SEGMENT')
Anyone can help ùme to resolve this problem? tahnk you