You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ts - the data
freq - if not None then resample data to it.
cycle - is a period of X axis
align - used only when cycle is int. Defines if last or first period should be full.
aggregation - how to aggregate data when resampling
target - defines what column to plot
segments - allows to specify segments to plot, if None plot all the segments
columns_num - number of graphics columns
figsize - size of the figure per subplot with one segment in inches
**plot_kwargs - additional arguments that will be passed to inner plotting function
Notes on cycle and freq: if cycle == int and freq == None then consider freq current and just split the data by chunks of cycle size. Use align parameter to fill first or last period.
if cycle == int and freq != None then resample data using freq and split the data by chunks of cycle size. Use align parameter to fill first or last period.
if cycle == Literal and freq == None then consider freq current and split the data using information about time:
hour - starts at 00 minutes ends at 59 minutes
day - starts at 00:00, ends at 23:59
week starts at Monday 00:00 ends at Sunday 23:59
and so on
Also consider adding custom X axis such as Weekdays[Mon, Tue, Wed, etc], Months[Jan, Feb, Mar, Apr, etc] and check if data allows using it.
if cycle == Literal and freq != None then resample first using freq and split the data using information about time just as in the above case.
Example
If data has freq = "D" then to plot weekly seasonality we need to call seasonal_plot(ts, cycle="week")
it should plot a graph that will start at Monday and end on Sunday.
Note that seasonal_plot(ts, cycle=7) may not start Monday because time series can start and end at any weekday possible.
If data has freq = "D" then to plot yearly seasonality as above example we need to call: seasonal_plot(ts, freq="M", cycle="year")
🚀 Feature Request
Add plot function that allows to create plots similar to the above one.
Motivation
Seasonal plot allows to analyse and extract useful info from time series.
Proposal
Where:
Notes on cycle and freq:
if cycle == int and freq == None
then consider freq current and just split the data by chunks of cycle size. Use align parameter to fill first or last period.if cycle == int and freq != None
then resample data using freq and split the data by chunks of cycle size. Use align parameter to fill first or last period.if cycle == Literal and freq == None
then consider freq current and split the data using information about time:Also consider adding custom X axis such as Weekdays[Mon, Tue, Wed, etc], Months[Jan, Feb, Mar, Apr, etc] and check if data allows using it.
if cycle == Literal and freq != None
then resample first using freq and split the data using information about time just as in the above case.Example
If data has freq = "D" then to plot weekly seasonality we need to call
seasonal_plot(ts, cycle="week")
it should plot a graph that will start at Monday and end on Sunday.
If data has freq = "D" then to plot yearly seasonality as above example we need to call:
seasonal_plot(ts, freq="M", cycle="year")
Test cases
Should test, that split by season works correctly
Alternatives
No response
Additional context
Examples:
Checklist
The text was updated successfully, but these errors were encountered: