DEPR: DatetimeIndex.offset · Issue #20716 · pandas-dev/pandas (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

@jschendel

Description

@jschendel

DatetimeIndex.offset and DatimeIndex.freq refer to the same thing, and are used interchangeably throughout the code for DatetimeIndex:

@property
def freq(self):
"""get/set the frequency of the Index"""
return self.offset

Is there a reason for having both?

TimedeltaIndex and PeriodIndex only have freq, so it seems like we could keep freq for consistency, deprecate DatetimeIndex.offset, and modify the DatetimeIndex code to only use freq.