Skip to content

ENH: add na_action to Categorical.map & CategoricalIndex.map #51645

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Mar 30, 2023
Merged
Prev Previous commit
Next Next commit
pass test_map
  • Loading branch information
topper-123 committed Mar 29, 2023
commit 6dfdf878c5d723bff812091f1a74b19382b832fd
8 changes: 2 additions & 6 deletions pandas/tests/extension/test_categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,8 @@ def test_combine_add(self, data_repeated):

@pytest.mark.parametrize("na_action", [None, "ignore"])
def test_map(self, data, na_action):
if na_action is not None:
with pytest.raises(NotImplementedError, match=""):
data.map(lambda x: x, na_action=na_action)
else:
result = data.map(lambda x: x, na_action=na_action)
self.assert_extension_array_equal(result, data)
result = data.map(lambda x: x, na_action=na_action)
self.assert_extension_array_equal(result, data)


class TestCasting(base.BaseCastingTests):
Expand Down