pyActigraphy.light.LightMetricsMixin.summary_statistics_per_time_bin

LightMetricsMixin.summary_statistics_per_time_bin(bins='24h', agg_func=['mean', 'median', 'sum', 'std', 'min', 'max'])[source]

Summary statistics.

Calculate summary statistics (ex: mean, median, etc) according to a user-defined (regular or arbitrary) binning.

Parameters
  • bins (str or list of tuples, optional) – If set to a string, bins is used to define a regular binning where every bin is of length “bins”. Ex: “2h”. Otherwise, the list of 2-tuples is used to define an arbitrary binning. Ex: [(‘2000-01-01 00:00:00’,’2000-01-01 11:59:00’)]. Default is ‘24h’.

  • agg_func (list, optional) – List of aggregation functions to be used on every bin. Default is [‘mean’, ‘median’, ‘sum’, ‘std’, ‘min’, ‘max’].

Returns

ss – A pandas DataFrame with summary statistics per channel.

Return type

pd.DataFrame