Days as dummy variables How should you treat "days" as a variable from a statistical perspective. The "days" variable can be defined as an integer describing the day of the year as follows: days = 1,2,3,4...365.

*

*Using a dummy variable approach would create a lot of extra variables, and i'm not sure that is a wise decision.

*Using a integer approach, simply stating that days = [0,365], is also not necessarily correct since the dependent variable might increase during H1 and decrease during H2, such that the variable impact cancels out?

Any take on how to deal with such a varialbe?
 A: A reasonable way to feature engineer time is to project the units on a circle, where the units can be day of the week, month of the year or day of the year. Just spread out the days along the unit circle and then apply the sinus and cosine to the resulting values.
Projecting the units on a circle preserves the circularity of the values. This might be what Nick Cox suggested, but then a little more explicit.
Please find an example below of creating features for days in a month. In this case there are 30 days in the month. By projecting all the days on a unit circle clockwise, for each day one can calculate a sin and cos. If the circle is centered around zero, these values turn out to be the x and y values of the points of the circle. The x and y values can now be used as features. The same goes for days in a year, the picture just turns out less nice.
import numpy as np
import matplotlib.pyplot as plt
days = np.arange(30)
x = days * 2*np.pi/30
plt.title('Projection of 30 days on a unit circle')
plt.xlabel('sin')
plt.ylabel('cos')
plt.scatter(np.sin(x), np.cos(x))


