From 5248094f6abc710bc616134f9f2878564b87aa6c Mon Sep 17 00:00:00 2001 From: gfyoung Date: Sun, 4 Nov 2018 12:45:40 -0800 Subject: [PATCH] DOC: Fix syntax error in groupby docs Follow-up to gh-23394. --- doc/source/groupby.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/source/groupby.rst b/doc/source/groupby.rst index 0a896bac0f2d7..17a723e2a2f42 100644 --- a/doc/source/groupby.rst +++ b/doc/source/groupby.rst @@ -133,7 +133,8 @@ but the specified columns .. ipython:: python df2 = df.set_index(['A', 'B']) - grouped = df2.groupby(level=df2.index.names.difference(['B']) + grouped = df2.groupby(level=df2.index.names.difference(['B'])) + grouped.sum() These will split the DataFrame on its index (rows). We could also split by the columns: