@Substitution(name='<STR_LIT>')<EOL><INDENT>@Appender(_common_see_also)<EOL>def shift(self, periods=<NUM_LIT:1>, freq=None, axis=<NUM_LIT:0>, fill_value=None):<DEDENT>
if freq is not None or axis != <NUM_LIT:0> or not isna(fill_value):<EOL><INDENT>return self.apply(lambda x: x.shift(periods, freq,<EOL>axis, fill_value))<EOL><DEDENT>return self._get_cythonized_result('<STR_LIT>',<EOL>self.grouper, cython_dtype=np.int64,<EOL>needs_ngroups=True,<EOL>result_is_index=True,<EOL>periods=periods)<EOL>
Shift each group by periods observations.

Parameters
----------
periods : integer, default 1
    number of periods to shift
freq : frequency string
axis : axis to shift, default 0
fill_value : optional

    .. versionadded:: 0.24.0