quantlab.utils.resample.source_interval_seconds#

quantlab.utils.resample.source_interval_seconds(timestamps)[source]#

Return the most common spacing of timestamps, in seconds.

The mode is used rather than the minimum so that gaps such as weekends do not distort the answer.

Examples

>>> source_interval_seconds(pd.date_range("2024-01-01", periods=3, freq="min"))
60.0