def to_perioddelta(self, freq):
<EOL>from pandas.core.arrays.timedeltas import TimedeltaArray<EOL>i8delta = self.asi8 - self.to_period(freq).to_timestamp().asi8<EOL>m8delta = i8delta.view('<STR_LIT>')<EOL>return TimedeltaArray(m8delta)<EOL>
Calculate TimedeltaArray of difference between index
values and index converted to PeriodArray at specified
freq. Used for vectorized offsets

Parameters
----------
freq : Period frequency

Returns
-------
TimedeltaArray/Index