Skip to content

Commit 2547739

Browse files
committed
API: drop kwargs from Series.dropna, add how parameter
1 parent 28c9ccc commit 2547739

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

doc/source/whatsnew/v1.0.0.rst

+2
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ Other API changes
192192
Now, pandas custom formatters will only be applied to plots created by pandas, through :meth:`~DataFrame.plot`.
193193
Previously, pandas' formatters would be applied to all plots created *after* a :meth:`~DataFrame.plot`.
194194
See :ref:`units registration <whatsnew_1000.matplotlib_units>` for more.
195+
- :meth:`Series.dropna` has dropped its ``**kwargs`` argument in favor of a single ``how`` parameter.
196+
Supplying anything else than ``how`` to ``**kwargs`` would have raised a ``typeError`` anyway (:issue:`xxxxx`)
195197
-
196198

197199

pandas/core/series.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -4595,7 +4595,7 @@ def notna(self):
45954595
def notnull(self):
45964596
return super().notnull()
45974597

4598-
def dropna(self, axis=0, inplace=False, **kwargs):
4598+
def dropna(self, axis=0, inplace=False, how=None):
45994599
"""
46004600
Return a new Series with missing values removed.
46014601
@@ -4608,7 +4608,7 @@ def dropna(self, axis=0, inplace=False, **kwargs):
46084608
There is only one axis to drop values from.
46094609
inplace : bool, default False
46104610
If True, do operation inplace and return None.
4611-
**kwargs
4611+
how : str, optional
46124612
Not in use.
46134613
46144614
Returns
@@ -4667,12 +4667,6 @@ def dropna(self, axis=0, inplace=False, **kwargs):
46674667
dtype: object
46684668
"""
46694669
inplace = validate_bool_kwarg(inplace, "inplace")
4670-
kwargs.pop("how", None)
4671-
if kwargs:
4672-
raise TypeError(
4673-
"dropna() got an unexpected keyword "
4674-
'argument "{0}"'.format(list(kwargs.keys())[0])
4675-
)
46764670
# Validate the axis parameter
46774671
self._get_axis_number(axis or 0)
46784672

0 commit comments

Comments
 (0)