Infer the most likely frequency given the input index.
If passed a Series will use the values of the series (NOT THE INDEX).
None if no discernible frequency.
If the index is not datetime-like.
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'
© 2008–2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
© 2011–2025, Open source contributors
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/2.3.0/reference/api/pandas.infer_freq.html