pandas.errors.NullFrequencyError

exceptionpandas.errors.NullFrequencyError[source]

Exception raised when a freq cannot be null.

Particularly DatetimeIndex.shift, TimedeltaIndex.shift, PeriodIndex.shift.

Examples

>>> df = pd.DatetimeIndex(["2011-01-01 10:00", "2011-01-01"], freq=None)
>>> df.shift(2)
Traceback (most recent call last):
NullFrequencyError: Cannot shift with no freq

© 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.errors.NullFrequencyError.html