@apply_index_wraps
    def apply_index(self, i):

        if not type(self) is DateOffset:
            raise NotImplementedError("DateOffset subclass %s "
                                      "does not have a vectorized "
                                      "implementation"
                                      % (self.__class__.__name__,))
        relativedelta_fast = set(['years', 'months', 'weeks',
                                  'days', 'hours', 'minutes',
                                  'seconds', 'microseconds'])
        # relativedelta/_offset path only valid for base DateOffset
        if (self._use_relativedelta and
                set(self.kwds).issubset(relativedelta_fast)):

            months = ((self.kwds.get('years', 0) * 12 +
                       self.kwds.get('months', 0)) * self.n)
            if months:
                shifted = tslib.shift_months(i.asi8, months)
                i = i._shallow_copy(shifted)

            weeks = (self.kwds.get('weeks', 0)) * self.n
            if weeks:
                i = (i.to_period('W') + weeks).to_timestamp() + \
                    i.to_perioddelta('W')

            timedelta_kwds = dict((k, v) for k, v in self.kwds.items()
                                  if k in ['days', 'hours', 'minutes',
                                           'seconds', 'microseconds'])
            if timedelta_kwds:
                delta = Timedelta(**timedelta_kwds)
                i = i + (self.n * delta)
            return i
        elif not self._use_relativedelta and hasattr(self, '_offset'):
            # timedelta
            return i + (self._offset * self.n)
        else:
            # relativedelta with other keywords
            raise NotImplementedError("DateOffset with relativedelta "
                                      "keyword(s) %s not able to be "
                                      "applied vectorized" %
                                      (set(self.kwds) - relativedelta_fast),)
Vectorized apply of DateOffset to DatetimeIndex,
dataset/ETHPy150Open pydata/pandas/pandas/tseries/offsets.py/DateOffset.apply_index