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 need to convert 0 to Monday, 1 to Tuestday and so on.
Here is an example of my dataframe:
datetime season holiday workingday weather temp atemp humidity windspeed count
0 2011-01-01 00:00:00 1 0 0 1 9.84 14.395 81 0.0000 16
1 2011-01-01 01:00:00 1 0 0 1 9.02 13.635 80 0.0000 40
2 2011-01-01 02:00:00 1 0 0 1 9.02 13.635 80 0.0000 32
3 2011-01-01 03:00:00 1 0 0 1 9.84 14.395 75 0.0000 13
4 2011-01-01 04:00:00 1 0 0 1 9.84 14.395 75 0.0000 1
5 2011-01-01 05:00:00 1 0 0 2 9.84 12.880 75 6.0032 1
6 2011-01-01 06:00:00 1 0 0 1 9.02 13.635 80 0.0000 2
7 2011-01-01 07:00:00 1 0 0 1 8.20 12.880 86 0.0000 3
8 2011-01-01 08:00:00 1 0 0 1 9.84 14.395 75 0.0000 8
9 2011-01-01 09:00:00 1 0 0 1 13.12 17.425 76 0.0000 14
Another question more, which is the difference between pandas.DatetimeIndex.dayofweek
and pandas.DatetimeIndex.weekday
?