From 26c14e9ef770b2e5f735b3bad7a43cdfd6722ba3 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Sat, 23 Sep 2017 12:33:32 +0200 Subject: [PATCH] DOC: correct example use of nth dropna keyword dropna=True is deprecated, see https://github.com/pandas-dev/pandas/pull/17493 --- doc/source/groupby.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/groupby.rst b/doc/source/groupby.rst index e9a7d8dd0a46e..91d806ca5dd4f 100644 --- a/doc/source/groupby.rst +++ b/doc/source/groupby.rst @@ -1060,7 +1060,7 @@ To select from a DataFrame or Series the nth item, use the nth method. This is a g.nth(-1) g.nth(1) -If you want to select the nth not-null item, use the ``dropna`` kwarg. For a DataFrame this should be either ``'any'`` or ``'all'`` just like you would pass to dropna, for a Series this just needs to be truthy. +If you want to select the nth not-null item, use the ``dropna`` kwarg. For a DataFrame this should be either ``'any'`` or ``'all'`` just like you would pass to dropna: .. ipython:: python @@ -1072,7 +1072,7 @@ If you want to select the nth not-null item, use the ``dropna`` kwarg. For a Dat g.nth(-1, dropna='any') # NaNs denote group exhausted when using dropna g.last() - g.B.nth(0, dropna=True) + g.B.nth(0, dropna='all') As with other methods, passing ``as_index=False``, will achieve a filtration, which returns the grouped row.