Skip to content

Commit e0b54be

Browse files
Moving skipna after na_action for compatibility with positional args
1 parent aaf91f7 commit e0b54be

File tree

4 files changed

+18
-15
lines changed

4 files changed

+18
-15
lines changed

pandas/core/frame.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10643,8 +10643,8 @@ def apply(
1064310643
def map(
1064410644
self,
1064510645
func: PythonFuncType,
10646-
skipna: bool = False,
1064710646
na_action: Literal["ignore"] | None | lib.NoDefault = lib.no_default,
10647+
skipna: bool = False,
1064810648
**kwargs,
1064910649
) -> DataFrame:
1065010650
"""
@@ -10661,10 +10661,13 @@ def map(
1066110661
----------
1066210662
func : callable
1066310663
Python function, returns a single value from a single value.
10664-
skipna : bool = False
10665-
If ``True``, propagate missing values without passing them to ``func``.
1066610664
na_action : {None, 'ignore'}, default None
1066710665
If 'ignore', propagate NaN values, without passing them to func.
10666+
10667+
.. deprecated:: 3.0.0
10668+
Use ``skipna`` instead.
10669+
skipna : bool = False
10670+
If ``True``, propagate missing values without passing them to ``func``.
1066810671
**kwargs
1066910672
Additional keyword arguments to pass as keywords arguments to
1067010673
`func`.

pandas/core/indexes/base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6353,8 +6353,8 @@ def groupby(self, values) -> PrettyDict[Hashable, Index]:
63536353
def map(
63546354
self,
63556355
mapper,
6356-
skipna: bool = False,
63576356
na_action: Literal["ignore"] | None | lib.NoDefault = lib.no_default,
6357+
skipna: bool = False,
63586358
):
63596359
"""
63606360
Map values using an input mapping or function.
@@ -6363,15 +6363,15 @@ def map(
63636363
----------
63646364
mapper : function, dict, or Series
63656365
Mapping correspondence.
6366-
skipna : bool = False
6367-
If ``True``, propagate NA values, without passing them to the
6368-
mapping correspondence.
63696366
na_action : {None, 'ignore'}
63706367
If 'ignore', propagate NA values, without passing them to the
63716368
mapping correspondence.
63726369
63736370
.. deprecated:: 3.0.0
63746371
Use ``skipna`` instead.
6372+
skipna : bool = False
6373+
If ``True``, propagate NA values, without passing them to the
6374+
mapping correspondence.
63756375
63766376
Returns
63776377
-------

pandas/core/indexes/category.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,8 @@ def _is_comparable_dtype(self, dtype: DtypeObj) -> bool:
458458
def map(
459459
self,
460460
mapper,
461-
skipna: bool = False,
462461
na_action: Literal["ignore"] | None | lib.NoDefault = lib.no_default,
462+
skipna: bool = False,
463463
):
464464
"""
465465
Map values using input an input mapping or function.
@@ -477,15 +477,15 @@ def map(
477477
----------
478478
mapper : function, dict, or Series
479479
Mapping correspondence.
480-
skipna : bool, default False
481-
If ``True``, propagate NaN values, without passing them to
482-
the mapping correspondence.
483480
na_action : {None, 'ignore'}, default 'ignore'
484481
If 'ignore', propagate NaN values, without passing them to
485482
the mapping correspondence.
486483
487484
.. deprecated:: 3.0.0
488485
Use ``skipna`` instead.
486+
skipna : bool, default False
487+
If ``True``, propagate NaN values, without passing them to
488+
the mapping correspondence.
489489
490490
Returns
491491
-------

pandas/core/series.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4327,8 +4327,8 @@ def unstack(
43274327
def map(
43284328
self,
43294329
func: Callable | Mapping | Series | None = None,
4330-
skipna: bool = False,
43314330
na_action: Literal["ignore"] | None | lib.NoDefault = lib.no_default,
4331+
skipna: bool = False,
43324332
engine: Callable | None = None,
43334333
**kwargs,
43344334
) -> Series:
@@ -4343,15 +4343,15 @@ def map(
43434343
----------
43444344
func : function, collections.abc.Mapping subclass or Series
43454345
Function or mapping correspondence.
4346-
skipna : bool, default False
4347-
If ``True``, do not pass missing values to the function, and
4348-
propagate them to the result directly instead.
43494346
na_action : {None, 'ignore'}, default None
43504347
If 'ignore', propagate NaN values, without passing them to the
43514348
mapping correspondence.
43524349
43534350
.. deprecated:: 3.0.0
43544351
Use ``skipna`` instead.
4352+
skipna : bool, default False
4353+
If ``True``, do not pass missing values to the function, and
4354+
propagate them to the result directly instead.
43554355
engine : decorator, optional
43564356
Choose the execution engine to use to run the function. Only used for
43574357
functions. If ``map`` is called with a mapping or ``Series``, an

0 commit comments

Comments
 (0)