Visualize rolling distributions of a time series by aggregating values into fixed windows (weeks, months, etc.) and rendering box plots per window. Supports pandas or polars inputs, tidy-style selectors, grouped data, and an optional Plotly dropdown for faceted series.
Parameters
Name
Type
Description
Default
data
pd.DataFrame or pd.core.groupby.generic.DataFrameGroupBy
Long-format time series data or grouped data whose groups are treated as facet combinations. Polars DataFrames are converted automatically.
required
date_column
str or ColumnSelector
Datetime column to bucket by period.
required
value_column
str or ColumnSelector
Numeric column plotted on the y-axis.
required
period
str, pd.DateOffset, Timedelta, or timedelta
Window size passed to :func:pytimetk.floor_date. Accepts pandas frequency strings ("7D", "1M") or human-friendly durations ("30 minutes", "2 weeks").
required
color_column
str or ColumnSelector
Optional categorical column that splits the distribution/legend.
None
color_palette
dict, sequence, or str
Custom palette for color_column. Dicts map {category: "#RRGGBB"}. Sequences are cycled; "timetk" reuses the package palette.
None
facet_vars
str, sequence, or ColumnSelector
Additional columns used to facet the output. Combined with any pandas groupby columns on the input.
None
facet_ncols
int
Number of subplot columns when plotly_dropdown is False.
1
facet_label_sep
str
Separator used when composing facet labels (default ", ").