get_diff_summary

get_diff_summary(idx, numeric=False)

Calculates summary statistics of the time differences between consecutive values in a datetime index.

Parameters

Name Type Description Default
idx pd.Series or pd.DateTimeIndex The idx parameter can be either a pandas Series or a pandas DateTimeIndex. It represents the index values for which you want to calculate the difference summary. required
numeric bool The numeric parameter is a boolean flag that indicates whether the input index should be treated as numeric or not. - If numeric is set to True, the index values are converted to integers representing the number of seconds since the Unix epoch (January 1, 1970). - If numeric is set to False, the index values are treated as datetime values. The default value of numeric is False. False

Returns

Type Description
pd.DataFrame The function get_diff_summary returns a pandas DataFrame containing summary statistics including: If numeric is set to False, the column names are: - diff_min: The minimum time difference between consecutive observations in the time series as a timedelta. - diff_q25: The 25th percentile of the time difference between consecutive observations in the time series as a timedelta. - diff_median: The median time difference between consecutive observations in the time series as a timedelta. - diff_mean: The mean time difference between consecutive observations in the time series as a timedelta. - diff_q75: The 75th percentile of the time difference between consecutive observations in the time series as a timedelta. - diff_max: The maximum time difference between consecutive observations in the time series as a timedelta. If numeric is set to True, the column names are: - diff_min_seconds: The minimum time difference between consecutive observations in the time series in seconds. - diff_q25_seconds: The 25th percentile of the time difference between consecutive observations in the time series in seconds. - diff_median_seconds: The median time difference between consecutive observations in the time series in seconds. - diff_mean_seconds: The mean time difference between consecutive observations in the time series in seconds. - diff_q75_seconds: The 75th percentile of the time difference between consecutive observations in the time series in seconds. - diff_max_seconds: The maximum time difference between consecutive observations in the time series in seconds.