Skip to content

Commit 77fdffd

Browse files
authored
DOC: Clarify groupby axis operations (#62853)
1 parent 8f359f8 commit 77fdffd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

doc/source/user_guide/groupby.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ 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). To split by columns, first do
140+
DataFrame groupby always operates along axis 0 (rows). To split by columns, first do
141141
a transpose:
142142

143143
.. ipython::

pandas/core/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9430,7 +9430,7 @@ def groupby(
94309430
index. If a dict or Series is passed, the Series or dict VALUES
94319431
will be used to determine the groups (the Series' values are first
94329432
aligned; see ``.align()`` method). If a list or ndarray of length
9433-
equal to the selected axis is passed (see the `groupby user guide
9433+
equal to the number of rows is passed (see the `groupby user guide
94349434
<https://pandas.pydata.org/pandas-docs/stable/user_guide/groupby.html#splitting-an-object-into-groups>`_),
94359435
the values are used as-is to determine the groups. A label or list
94369436
of labels may be passed to group by the columns in ``self``.

0 commit comments

Comments
 (0)