Skip to content

Commit c293caf

Browse files
authored
DOC: sort has no effect on filters (#51825)
* DOC: sort has no effect on filters * DOC: update docs ref * DOC: as_index has no effect on filters * DOC: change duplicate target name * DOC: sort and as_index have no effect in transformations
1 parent 5d04432 commit c293caf

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

pandas/core/shared_docs.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,23 @@
112112
If the axis is a MultiIndex (hierarchical), group by a particular
113113
level or levels. Do not specify both ``by`` and ``level``.
114114
as_index : bool, default True
115-
For aggregated output, return object with group labels as the
115+
Return object with group labels as the
116116
index. Only relevant for DataFrame input. as_index=False is
117-
effectively "SQL-style" grouped output.
117+
effectively "SQL-style" grouped output. This argument has no effect
118+
on filtrations (see the `filtrations in the user guide
119+
<https://pandas.pydata.org/docs/dev/user_guide/groupby.html#filtration>`_),
120+
such as ``head()``, ``tail()``, ``nth()`` and in transformations
121+
(see the `transformations in the user guide
122+
<https://pandas.pydata.org/docs/dev/user_guide/groupby.html#transformation>`_).
118123
sort : bool, default True
119124
Sort group keys. Get better performance by turning this off.
120125
Note this does not influence the order of observations within each
121126
group. Groupby preserves the order of rows within each group.
127+
This argument has no effect on filtrations (see the `filtrations in the user guide
128+
<https://pandas.pydata.org/docs/dev/user_guide/groupby.html#filtration>`_),
129+
such as ``head()``, ``tail()``, ``nth()`` and in transformations
130+
(see the `transformations in the user guide
131+
<https://pandas.pydata.org/docs/dev/user_guide/groupby.html#transformation>`_).
122132
123133
.. versionchanged:: 2.0.0
124134

0 commit comments

Comments
 (0)