# Should the day of the week variable be splitted into 7 columns or is one enough? Time-series forecast

I have time-series data, in which I added a variable "dayofweek" with the day of the week varying from $$0$$ (Monday) to $$6$$ (Sunday) (Python's default). I'm using boosting models like GBM and XGBoost to forecast my data. However, should I use a dummy/binary variable for each day of the week or is it the same using one single column for all of them?

     Date     y    dayofweek
01-03-2020   200      6
02-03-2020   250      0
03-03-2020   333      1
04-03-2020   333      2
05-03-2020   200      3
06-03-2020   150      4
07-03-2020   260      5
08-03-2020   300      6


Vs

    Date     y     Monday  Tuesday Wednesday Thursday Friday Saturday Sunday
01-03-2020   200      0        0       0         0      0        0       1
02-03-2020   250      1        0       0         0      0        0       0
03-03-2020   333      0        1       0         0      0        0       0
04-03-2020   333      0        0       1         0      0        0       0
05-03-2020   200      0        0       0         1      0        0       0
06-03-2020   150      0        0       0         0      1        0       0
07-03-2020   260      0        0       0         0      0        1       0
08-03-2020   300      0        0       0         0      0        0       1


I know that these types of models work well with tabular data, but is there any significant difference in results by using dummy/binary vs one single column for days of the week?

• Not an answer to your question but you might want to consider whether decision tree based models are really the right approach here, since they can't extrapolate trends into the future. I think all your future predictions will be equal to your in-sample prediction for the latest date in your training set, plus some learned weekly variation. – Jonny Lomond Mar 1 at 12:13
• My dataset has much more variables and I'm actually getting good predictions. The dataset I showed here is just an example for the question :) – Amateur Mathematician Mar 1 at 14:02