@@ -1250,10 +1250,10 @@ def map(
1250
1250
>>> cat
1251
1251
['a', 'b', 'c']
1252
1252
Categories (3, object): ['a', 'b', 'c']
1253
- >>> cat.map(lambda x: x.upper())
1253
+ >>> cat.map(lambda x: x.upper(), na_action=None )
1254
1254
['A', 'B', 'C']
1255
1255
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 )
1257
1257
['first', 'second', 'third']
1258
1258
Categories (3, object): ['first', 'second', 'third']
1259
1259
@@ -1264,19 +1264,19 @@ def map(
1264
1264
>>> cat
1265
1265
['a', 'b', 'c']
1266
1266
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 )
1268
1268
[3, 2, 1]
1269
1269
Categories (3, int64): [3 < 2 < 1]
1270
1270
1271
1271
If the mapping is not one-to-one an :class:`~pandas.Index` is returned:
1272
1272
1273
- >>> cat.map({'a': 'first', 'b': 'second', 'c': 'first'})
1273
+ >>> cat.map({'a': 'first', 'b': 'second', 'c': 'first'}, na_action=None )
1274
1274
Index(['first', 'second', 'first'], dtype='object')
1275
1275
1276
1276
If a `dict` is used, all unmapped categories are mapped to `NaN` and
1277
1277
the result is an :class:`~pandas.Index`:
1278
1278
1279
- >>> cat.map({'a': 'first', 'b': 'second'})
1279
+ >>> cat.map({'a': 'first', 'b': 'second'}, na_action=None )
1280
1280
Index(['first', 'second', nan], dtype='object')
1281
1281
"""
1282
1282
if na_action is lib .no_default :
0 commit comments