xorbits.pandas.infer_freq#

xorbits.pandas.infer_freq(index, warn: bool = True) str | None[source]#

Infer the most likely frequency given the input index.

Parameters
  • index (DatetimeIndex or TimedeltaIndex) – If passed a Series will use the values of the series (NOT THE INDEX).

  • warn (bool, default True) –

    Deprecated since version 1.5.0.

Returns

None if no discernible frequency.

Return type

str or None

Raises
  • TypeError – If the index is not datetime-like.

  • ValueError – If there are fewer than three values.

Examples

>>> idx = pd.date_range(start='2020/12/01', end='2020/12/30', periods=30)  
>>> pd.infer_freq(idx)  
'D'

This docstring was copied from pandas.