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