Skip to content

Commit 3635d81

Browse files
committed
DOC: Simplify groupby docs per reviewer feedback
- Combine redundant sentences about axis 0 - Keep original transpose wording - Remove redundant note block
1 parent 6bfdbde commit 3635d81

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

doc/source/user_guide/groupby.rst

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,8 @@ We could naturally group by either the ``A`` or ``B`` columns, or both:
137137

138138
``df.groupby('A')`` is just syntactic sugar for ``df.groupby(df['A'])``.
139139

140-
The above GroupBy will split the DataFrame on its index (rows). DataFrame groupby
141-
always operates along axis 0 (rows). To split by columns instead, first transpose
142-
the DataFrame:
140+
DataFrame groupby always operates along axis 0 (rows). To split by columns, first do
141+
a transpose:
143142

144143
.. ipython::
145144

@@ -152,11 +151,6 @@ the DataFrame:
152151

153152
In [5]: grouped = df.T.groupby(get_letter_type)
154153

155-
.. note::
156-
157-
Prior to pandas 3.0, groupby had an ``axis`` parameter. This has been removed.
158-
To group by columns, transpose your DataFrame using ``.T`` before calling groupby.
159-
160154
pandas :class:`~pandas.Index` objects support duplicate values. If a
161155
non-unique index is used as the group key in a groupby operation, all values
162156
for the same index value will be considered to be in one group and thus the

0 commit comments

Comments
 (0)