'Cyclic/Seasonal cubic spline

I would like to fit a cubic spline to a time series that is seasonal i.e. integrating the day of the year in the independent variables. I have been looking at scipy and statsmodels but I have found no examples as to how to apply them when the data is seasonal. Does anyone have an example/piece of code I could use, please?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source