glucopy.metrics.dt#
- glucopy.metrics.dt(df: DataFrame)[source]#
Calculates the Distance Travelled (DT).
\[DT = \sum_{i=1}^{N-1} | X_{i+1} - X_i |\]\(X_i\) is the glucose value at time i.
\(N\) is the number of glucose readings.
- Parameters:
df (pandas.DataFrame) – DataFrame containing the CGM values. The dataframe must contain ‘CGM’ column present in
glucopy.Gframe.data
.- Returns:
dt – Distance Travelled of CGM.
- Return type:
float
Notes
This function is meant to be used by
glucopy.Gframe.dt()