def _beg_apply_index(self, i, freq):

        off = i.to_perioddelta('D')

        from pandas.tseries.frequencies import get_freq_code
        base, mult = get_freq_code(freq)
        base_period = i.to_period(base)
        if self.n <= 0:
            # when subtracting, dates on start roll to prior
            roll = np.where(base_period.to_timestamp() == i - off,
                            self.n, self.n + 1)
        else:
            roll = self.n

        base = (base_period + roll).to_timestamp()
        return base + off
Offsets index to beginning of Period frequency
dataset/ETHPy150Open pydata/pandas/pandas/tseries/offsets.py/DateOffset._beg_apply_index