Skip to content

Commit 7e470c9

Browse files
committed
fix docstrings
1 parent 01b199d commit 7e470c9

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
@@ -1257,10 +1257,10 @@ def map(
12571257
>>> cat
12581258
['a', 'b', 'c']
12591259
Categories (3, object): ['a', 'b', 'c']
1260-
>>> cat.map(lambda x: x.upper())
1260+
>>> cat.map(lambda x: x.upper(), na_action=None)
12611261
['A', 'B', 'C']
12621262
Categories (3, object): ['A', 'B', 'C']
1263-
>>> cat.map({'a': 'first', 'b': 'second', 'c': 'third'})
1263+
>>> cat.map({'a': 'first', 'b': 'second', 'c': 'third'}, na_action=None)
12641264
['first', 'second', 'third']
12651265
Categories (3, object): ['first', 'second', 'third']
12661266
@@ -1271,19 +1271,19 @@ def map(
12711271
>>> cat
12721272
['a', 'b', 'c']
12731273
Categories (3, object): ['a' < 'b' < 'c']
1274-
>>> cat.map({'a': 3, 'b': 2, 'c': 1})
1274+
>>> cat.map({'a': 3, 'b': 2, 'c': 1}, na_action=None)
12751275
[3, 2, 1]
12761276
Categories (3, int64): [3 < 2 < 1]
12771277
12781278
If the mapping is not one-to-one an :class:`~pandas.Index` is returned:
12791279
1280-
>>> cat.map({'a': 'first', 'b': 'second', 'c': 'first'})
1280+
>>> cat.map({'a': 'first', 'b': 'second', 'c': 'first'}, na_action=None)
12811281
Index(['first', 'second', 'first'], dtype='object')
12821282
12831283
If a `dict` is used, all unmapped categories are mapped to `NaN` and
12841284
the result is an :class:`~pandas.Index`:
12851285
1286-
>>> cat.map({'a': 'first', 'b': 'second'})
1286+
>>> cat.map({'a': 'first', 'b': 'second'}, na_action=None)
12871287
Index(['first', 'second', nan], dtype='object')
12881288
"""
12891289
if na_action is lib.no_default:

0 commit comments

Comments
 (0)