[e988c2]: / tests / spec / series_ops / test_map_values.py

Download this file

29 lines (23 with data), 454 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from ..tables import p
title = "Map from one set of values to another"
table_data = {
p: """
| i1
--+-----
1 | 101
2 | 201
3 | 301
4 |
""",
}
def test_map_values(spec_test):
spec_test(
table_data,
p.i1.map_values({101: "a", 201: "b", 301: "a"}, default="c"),
{
1: "a",
2: "b",
3: "a",
4: "c",
},
)