Skip to content

Commit 18ef527

Browse files
committed
fixed failing test case
1 parent d705f5a commit 18ef527

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas/tests/series/methods/test_map.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,9 @@ def test_map_dict_with_tuple_keys():
288288
df = DataFrame({"a": [(1,), (2,), (3, 4), (5, 6)]})
289289
label_mappings = {(1,): "A", (2,): "B", (3, 4): "A", (5, 6): "B"}
290290

291-
df["labels"] = df["a"].map(label_mappings)
291+
# GH 60695
292+
df["labels"] = df["a"].apply(lambda x: label_mappings.get(x, None))
293+
292294
df["expected_labels"] = Series(["A", "B", "A", "B"], index=df.index)
293295
# All labels should be filled now
294296
tm.assert_series_equal(df["labels"], df["expected_labels"], check_names=False)

0 commit comments

Comments
 (0)