Skip to content

Commit e2757a2

Browse files
jorisvandenbosschejreback
authored andcommitted
DOC: correct example use of nth dropna keyword (#17641)
dropna=True is deprecated, see #17493
1 parent 76d1744 commit e2757a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/source/groupby.rst

+2-2
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ To select from a DataFrame or Series the nth item, use the nth method. This is a
1060
g.nth(-1)
1060
g.nth(-1)
1061
g.nth(1)
1061
g.nth(1)
1062
1062
1063-
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.
1063+
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:
1064

1064

1065
.. ipython:: python
1065
.. ipython:: python
1066
1066
@@ -1072,7 +1072,7 @@ If you want to select the nth not-null item, use the ``dropna`` kwarg. For a Dat
1072
g.nth(-1, dropna='any') # NaNs denote group exhausted when using dropna
1072
g.nth(-1, dropna='any') # NaNs denote group exhausted when using dropna
1073
g.last()
1073
g.last()
1074
1074
1075-
g.B.nth(0, dropna=True)
1075+
g.B.nth(0, dropna='all')
1076
1076
1077
As with other methods, passing ``as_index=False``, will achieve a filtration, which returns the grouped row.
1077
As with other methods, passing ``as_index=False``, will achieve a filtration, which returns the grouped row.
1078

1078

0 commit comments

Comments
 (0)