We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4503bb3 commit 5e348a1Copy full SHA for 5e348a1
pandas/core/arrays/categorical.py
@@ -1590,15 +1590,16 @@ def map(
1590
therefore only called once per unique category, and the result reused for
1591
all occurrences:
1592
1593
- >>> cat = pd.Categorical(["a", "a", "b"]) # doctest: +SKIP
1594
- >>> calls = [] # doctest: +SKIP
1595
- >>> def f(x): # doctest: +SKIP
+ >>> cat = pd.Categorical(["a", "a", "b"])
+ >>> calls = []
+ >>> def f(x):
1596
... calls.append(x)
1597
... return x.upper()
1598
- >>> cat.map(f)
+ >>> result = cat.map(f)
1599
+ >>> result
1600
['A', 'A', 'B']
1601
Categories (2, str): ['A', 'B']
- >>> calls # doctest: +SKIP
1602
+ >>> calls
1603
['a', 'b']
1604
"""
1605
assert callable(mapper) or is_dict_like(mapper)
0 commit comments