If I use this funtion pd.DatetimeIndex(dfTrain[\'datetime\']).weekday
I get number of the day, but I don\'t find any function which give the name of de day... So I
Adding to the previous correct answer from @jezrael, you can use this:
import calendar
df['weekday'] = pd.Series(pd.Categorical(df['datetime'].dt.weekday_name, categories=list(calendar.day_name)))
which also provides your new categorical variable with order (in this example: 'Monday', ..., 'Sunday') according to this. This will possibly be helpful on next steps of your analysis.