# pandas.core.groupby.DataFrameGroupBy.shift

DataFrameGroupBy.shift(periods=1, freq=None, axis=0, fill_value=None)

  Shift each group by periods observations.

  If freq is passed, the index will be increased using the periods and the freq.

  Parameters
    periods int, default 1

      Number of periods to shift.

    freq str, optional

      Frequency string.

    axis axis to shift, default 0

      Shift direction.

    fill_value optional

      The scalar value to use for newly introduced missing values.

  Returns
    Series or DataFrame

      Object shifted within each group.

  See also

  `Index.shift`

    Shift values of Index.

  `tshift`

    Shift the time index, using the index’s frequency if available.