I've been using LabelEncoder to transform my data into floats.
The problem is that I can an Date value that I also want to transform.
This is the code that I am using:
from sklearn.preprocessing import LabelEncoder
le = LabelEncoder()
le.fit(df_train['Departure'])
df_train['DateOfDeparture'] = le.transform(df_train['DateOfDeparture'])
And this is the error that I get:
ValueError: y contains previously unseen labels: '2011-12-05'
Does anyone knows how to transform Dates correctly?