TimeSelection.group

time.TimeSelection.group(grouping)

Groups the time series using the specified grouping.

Parameters

grouping: Literal['day', 'week', 'epiweek', 'month'] | TimeGrouping

The grouping to use. You can specify a supported string value – all of which act as shortcuts for common TimeGrouping instances – or you can provide a TimeGrouping instance to perform custom grouping.

The shortcut values are:

  • “day”: equivalent to ByDate
  • “week”: equivalent to ByWeek
  • “epiweek”: equivalent to ByEpiWeek
  • “month”: equivalent to ByMonth

Returns

TimeGroup

The grouping strategy object.