glucopy.Gframe.mean#

Gframe.mean(per_day: bool = False)[source]#

Calculates the mean of the CGM values.

Parameters:

per_day (bool, default False) – If True, returns a pandas.Series with the mean for each day. If False, returns the mean for the entire dataset.

Returns:

mean – Mean of the CGM values.

Return type:

float | pandas.Series

Examples

Calculating the mean for the entire dataset:

In [1]: import glucopy as gp

In [2]: gf = gp.data('prueba_1')

In [3]: gf.mean()
Out[3]: 144.28068149003755

Calculating the mean for each day:

In [4]: gf.mean(per_day=True)
Out[4]: 
Day
2020-11-27    277.636364
2020-11-28    138.677083
2020-11-29    146.552083
2020-11-30    120.052083
2020-12-01    139.229167
                 ...    
2021-03-14    146.645161
2021-03-15    126.593407
2021-03-16    161.957895
2021-03-17    113.833333
2021-03-18    170.000000
Name: Mean, Length: 112, dtype: float64