Skip to content

Commit 78c1a74

Browse files
authored
DOC: Fixed ES01, PR07, SA04 error in pandas.core.groupby.DataFrameGroupBy.shift (#32356)
1 parent f25ed6f commit 78c1a74

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

pandas/core/groupby/groupby.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -2312,26 +2312,35 @@ def _get_cythonized_result(
23122312
return self._wrap_transformed_output(output)
23132313

23142314
@Substitution(name="groupby")
2315-
@Appender(_common_see_also)
23162315
def shift(self, periods=1, freq=None, axis=0, fill_value=None):
23172316
"""
23182317
Shift each group by periods observations.
23192318
2319+
If freq is passed, the index will be increased using the periods and the freq.
2320+
23202321
Parameters
23212322
----------
23222323
periods : int, default 1
23232324
Number of periods to shift.
23242325
freq : str, optional
23252326
Frequency string.
23262327
axis : axis to shift, default 0
2328+
Shift direction.
23272329
fill_value : optional
2330+
The scalar value to use for newly introduced missing values.
23282331
23292332
.. versionadded:: 0.24.0
23302333
23312334
Returns
23322335
-------
23332336
Series or DataFrame
23342337
Object shifted within each group.
2338+
2339+
See Also
2340+
--------
2341+
Index.shift : Shift values of Index.
2342+
tshift : Shift the time index, using the index’s frequency
2343+
if available.
23352344
"""
23362345
if freq is not None or axis != 0 or not isna(fill_value):
23372346
return self.apply(lambda x: x.shift(periods, freq, axis, fill_value))

0 commit comments

Comments
 (0)