[e988c2]: / tests / spec / bool_series_ops / test_conversion.py

Download this file

26 lines (20 with data), 381 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
from ..tables import p
title = "Convert a boolean value to an integer"
table_data = {
p: """
| b1
--+----
1 | T
2 |
3 | F
""",
}
def test_bool_as_int(spec_test):
"""
Booleans are converted to 0 (False) or 1 (True).
"""
spec_test(
table_data,
p.b1.as_int(),
{1: 1, 2: None, 3: 0},
)