glucopy.metrics.gvp#

glucopy.metrics.gvp(df: DataFrame)[source]#

Calculates the Glucose Variability Percentage (GVP), with time in minutes.

\[GVP = \left( \frac{L}{T_0} - 1\right) * 100\]
  • \(L = \sum_{i=1}^N \sqrt{\Delta X_i^2 + \Delta T_i^2}\)

  • \(T_0 = \sum_{i=1}^N \Delta T_i\)

  • \(N\) is the number of glucose readings.

  • \(\Delta X_i\) is the difference between glucose values at time i and i-1.

  • \(\Delta T_i\) is the difference between times at time i and i-1.

Parameters:

df (pandas.DataFrame) – DataFrame containing the CGM values. The dataframe must contain ‘CGM’ and ‘Timestamp’ columns present in glucopy.Gframe.data.

Returns:

gvp – Glucose Variability Percentage.

Return type:

float

Notes

This function is meant to be used by glucopy.Gframe.gvp()