glucopy.Gframe.std#

Gframe.std(per_day: bool = False, ddof: int = 1)[source]#

Calculates the standard deviation of the CGM values.

Parameters:
  • per_day (bool, default False) – If True, returns a pandas.Series with the standard deviation for each day. If False, returns the standard deviation for the entire dataset.

  • ddof (int, default 1) – Delta Degrees of Freedom. The divisor used in calculations is N - ddof, where N represents the number of elements.

Returns:

std – Standard deviation of the CGM values.

Return type:

float | pandas.Series

Examples

Calculating the standard deviation for the entire dataset:

In [1]: import glucopy as gp

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

In [3]: gf.std()
Out[3]: 64.72869948664865

Calculating the standard deviation for each day:

In [4]: gf.std(per_day=True)
Out[4]: 
Day
2020-11-27    24.336280
2020-11-28    43.822968
2020-11-29    62.984020
2020-11-30    30.983992
2020-12-01    42.210370
                ...    
2021-03-14    41.304449
2021-03-15    76.089418
2021-03-16    44.160470
2021-03-17    37.014269
2021-03-18    50.011934
Name: Standard Deviation, Length: 112, dtype: float64