Skip to content

Commit d398d93

Browse files
committed
pre-commit
1 parent f258df2 commit d398d93

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

pandas/tests/arrays/categorical/test_map.py

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def test_map_str(data, categories, ordered, na_action):
3232
)
3333
tm.assert_categorical_equal(result, expected)
3434

35+
3536
def test_map(na_action):
3637
cat = Categorical(list("ABABC"), categories=list("CBA"), ordered=True)
3738
result = cat.map(lambda x: x.lower(), na_action=na_action)
@@ -65,6 +66,7 @@ def f(x):
6566
result = cat.map({"A": 10, "B": 20, "C": 30}, na_action=na_action)
6667
tm.assert_categorical_equal(result, exp)
6768

69+
6870
@pytest.mark.parametrize(
6971
("data", "f", "expected"),
7072
(
@@ -92,6 +94,7 @@ def test_map_with_nan_none(data, f, expected): # GH 24241
9294
else:
9395
tm.assert_index_equal(result, expected)
9496

97+
9598
@pytest.mark.parametrize(
9699
("data", "f", "expected"),
97100
(
@@ -119,6 +122,7 @@ def test_map_with_nan_ignore(data, f, expected): # GH 24241
119122
else:
120123
tm.assert_index_equal(result, expected)
121124

125+
122126
def test_map_with_dict_or_series(na_action):
123127
orig_values = ["a", "B", 1, "a"]
124128
new_values = ["one", 2, 3.0, "one"]

pandas/tests/indexes/categorical/test_map.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def test_map_str(data, categories, ordered):
2727
)
2828
tm.assert_index_equal(result, expected)
2929

30+
3031
def test_map():
3132
ci = CategoricalIndex(list("ABABC"), categories=list("CBA"), ordered=True)
3233
result = ci.map(lambda x: x.lower())
@@ -54,9 +55,7 @@ def f(x):
5455
return {"A": 10, "B": 20, "C": 30}.get(x)
5556

5657
result = ci.map(f)
57-
exp = CategoricalIndex(
58-
[10, 20, 10, 20, 30], categories=[20, 10, 30], ordered=False
59-
)
58+
exp = CategoricalIndex([10, 20, 10, 20, 30], categories=[20, 10, 30], ordered=False)
6059
tm.assert_index_equal(result, exp)
6160

6261
result = ci.map(Series([10, 20, 30], index=["A", "B", "C"]))
@@ -102,6 +101,7 @@ def test_map_with_nan_ignore(data, f, expected): # GH 24241
102101
result = values.map(f, na_action="ignore")
103102
tm.assert_index_equal(result, expected)
104103

104+
105105
@pytest.mark.parametrize(
106106
("data", "f", "expected"),
107107
(

0 commit comments

Comments
 (0)