DEPR: DatetimeIndex.offset (original) (raw)

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

pandas/pandas/core/indexes/datetimes.py

Lines 1729 to 1732 in4a34497

@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.