TimeGrouping

time.TimeGrouping()

Defines a time-axis grouping scheme. This is essentially a function that maps the simulation time axis info (ticks and dates) into a new series which describes the group membership of each time axis row.

TimeGrouping is an abstract class.

TimeGrouping is generic in the type of the key it uses for its time groups (GroupKeyType) – e.g., a grouping that groups weeks using the Monday of the week is datetime64 typed, while a grouping that groups days into arbitrary buckets might use integers to identify groups.

Attributes

group_format: Literal['date', 'tick', 'day', 'other']

What scale describes the result of the grouping? Are the group keys dates? Simulation ticks? Simulation days? Or some arbitrary other type?

Methods

Name Description
map Produce a column that describes the group membership of each “row”, where each entry of ticks and dates describes a row of the time series. This column will be used as the basis of a groupby operation.