Skip to content

Commit 75a8d75

Browse files
committed
DOC: minor groupby.rst edits
1 parent cbe7d74 commit 75a8d75

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

doc/source/groupby.rst

+5-4
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ with NaNs.
575575
For dataframes with multiple columns, filters should explicitly specify a column as the filter criterion.
576576

577577
.. ipython:: python
578-
578+
579579
dff['C'] = np.arange(8)
580580
dff.groupby('B').filter(lambda x: len(x['C']) > 2)
581581
@@ -723,13 +723,14 @@ To see the order in which each row appears within its group, use the
723723
df.groupby('A').cumcount()
724724
725725
df.groupby('A').cumcount(ascending=False) # kwarg only
726-
726+
727727
Examples
728-
~~~~~~~~
728+
--------
729729

730730
Regroup columns of a DataFrame according to their sum, and sum the aggregated ones.
731731

732732
.. ipython:: python
733-
733+
734734
df = pd.DataFrame({'a':[1,0,0], 'b':[0,1,0], 'c':[1,0,0], 'd':[2,3,4]})
735+
df
735736
df.groupby(df.sum(), axis=1).sum()

0 commit comments

Comments
 (0)