Skip to content

Commit 7775e2b

Browse files
committed
fix docstrings
1 parent 74ca632 commit 7775e2b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pandas/core/arrays/categorical.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1250,10 +1250,10 @@ def map(
12501250
>>> cat
12511251
['a', 'b', 'c']
12521252
Categories (3, object): ['a', 'b', 'c']
1253-
>>> cat.map(lambda x: x.upper())
1253+
>>> cat.map(lambda x: x.upper(), na_action=None)
12541254
['A', 'B', 'C']
12551255
Categories (3, object): ['A', 'B', 'C']
1256-
>>> cat.map({'a': 'first', 'b': 'second', 'c': 'third'})
1256+
>>> cat.map({'a': 'first', 'b': 'second', 'c': 'third'}, na_action=None)
12571257
['first', 'second', 'third']
12581258
Categories (3, object): ['first', 'second', 'third']
12591259
@@ -1264,19 +1264,19 @@ def map(
12641264
>>> cat
12651265
['a', 'b', 'c']
12661266
Categories (3, object): ['a' < 'b' < 'c']
1267-
>>> cat.map({'a': 3, 'b': 2, 'c': 1})
1267+
>>> cat.map({'a': 3, 'b': 2, 'c': 1}, na_action=None)
12681268
[3, 2, 1]
12691269
Categories (3, int64): [3 < 2 < 1]
12701270
12711271
If the mapping is not one-to-one an :class:`~pandas.Index` is returned:
12721272
1273-
>>> cat.map({'a': 'first', 'b': 'second', 'c': 'first'})
1273+
>>> cat.map({'a': 'first', 'b': 'second', 'c': 'first'}, na_action=None)
12741274
Index(['first', 'second', 'first'], dtype='object')
12751275
12761276
If a `dict` is used, all unmapped categories are mapped to `NaN` and
12771277
the result is an :class:`~pandas.Index`:
12781278
1279-
>>> cat.map({'a': 'first', 'b': 'second'})
1279+
>>> cat.map({'a': 'first', 'b': 'second'}, na_action=None)
12801280
Index(['first', 'second', nan], dtype='object')
12811281
"""
12821282
if na_action is lib.no_default:

0 commit comments

Comments
 (0)