glucopy.Gframe.pcv#
- Gframe.pcv(per_day: bool = False, ddof: int = 1)[source]#
Calculates the Percentage Coefficient of Variation (%CV) of the CGM values.
- Parameters:
per_day (bool, default False) – If True, returns a pandas.Series with the percentage coefficient of variation for each day. If False, returns the percentage coefficient of variation 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. By default ddof is 1.
- Returns:
pcv – Percentage coefficient of variation of the CGM values.
- Return type:
float | pandas.Series
Examples
Calculating the percentage coefficient of variation for the entire dataset:
In [1]: import glucopy as gp In [2]: gf = gp.data('prueba_1') In [3]: gf.pcv() Out[3]: 44.86303974875396
Calculating the percentage coefficient of variation for each day:
In [4]: gf.pcv(per_day=True) Out[4]: Day 2020-11-27 8.765523 2020-11-28 31.600728 2020-11-29 42.977226 2020-11-30 25.808792 2020-12-01 30.317189 ... 2021-03-14 28.166254 2021-03-15 60.105356 2021-03-16 27.266636 2021-03-17 32.516196 2021-03-18 29.418785 Name: % Coefficient of Variation, Length: 112, dtype: float64