DataFrameGroupBy.
shift
Shift each group by periods observations.
If freq is passed, the index will be increased using the periods and the freq.
Number of periods to shift.
Frequency string.
Shift direction.
The scalar value to use for newly introduced missing values.
New in version 0.24.0.
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.