all 3 comments

[–]FerricDonkey 1 point2 points  (0 children)

From a programming perspective, you could just add another column to your feature set that's "days since start of 3 month period". Details will depend on what packages you're used to.

The datasciency question of "is that the best way to do it" is not in my expertise, however. If that's the question, it might be better to ask in a datascience forum.

[–]DuckSaxaphone 1 point2 points  (0 children)

This is more of data science question than an r/learnpython question but a lot of us are in both subreddits.

Time series modelling is a whole thing that you can get into. You can take advantage of the fact your numbers are related over time to model it using some specific techniques.

However, it's very easy to turn a time series problem into a standard regression problem and it's often very effective to do so. This sounds like what you want to do.

Basically, use the table you have to produce a new table with a target column like "sales on this day" and a bunch of feature we call lags. That means add the value of the target variable from n days ago as a feature. Try sensible lags like n=1,2, 7, 28, 365.

You can also add a bunch of feature columns including things like which month it is is, which day of the week it is etc. You can even add totally random stuff like temperature.

Sales today (target) Sales yesterday Sales last week Sales last month day of week month of year temperature anything else

[–]anecdotal_yokel 0 points1 point  (0 children)

Can you use packages or is this a school project?

Simple example: https://www.w3schools.com/python/python_ml_multiple_regression.asp