3
3
4
4
@pytest .mark .parametrize ("test_data" ,
5
5
[
6
- {'a' : ["foo" , "bar" ],
7
- 'b' : ["baz" , "qux" ]},
8
- {'a' : [1.5 , 2.5 , 3.5 ], 'b' : [9.2 , 10.5 , 11.8 ]},
9
- {'A' : [1 , 2 , 3 , 4 ], 'B' : [1 , 2 , 3 , 4 ]}
6
+ {"a" : ["foo" , "bar" ],
7
+ "b" : ["baz" , "qux" ]},
8
+ {"a" : [1.5 , 2.5 , 3.5 ], "b" : [9.2 , 10.5 , 11.8 ]},
9
+ {"A" : [1 , 2 , 3 , 4 ], "B" : [1 , 2 , 3 , 4 ]}
10
10
],
11
11
ids = ["str_data" , "float_data" , "int_data" ])
12
12
def test_only_one_dtype (test_data , df_from_dict ):
@@ -22,12 +22,12 @@ def test_only_one_dtype(test_data, df_from_dict):
22
22
23
23
24
24
def test_float_int (df_from_dict ):
25
- df = df_from_dict ({'a' : [1 , 2 , 3 ], 'b' : [3 , 4 , 5 ],
26
- 'c' : [1.5 , 2.5 , 3.5 ], 'd' : [9 , 10 , 11 ],
27
- 'e' : [True , False , True ],
28
- 'f' : ["a" , "" , "c" ]})
25
+ df = df_from_dict ({"a" : [1 , 2 , 3 ], "b" : [3 , 4 , 5 ],
26
+ "c" : [1.5 , 2.5 , 3.5 ], "d" : [9 , 10 , 11 ],
27
+ "e" : [True , False , True ],
28
+ "f" : ["a" , "" , "c" ]})
29
29
dfX = df .__dataframe__ ()
30
- columns = {'a' : 0 , 'b' : 0 , 'c' : 2 , 'd' : 0 , 'e' : 20 , 'f' : 21 }
30
+ columns = {"a" : 0 , "b" : 0 , "c" : 2 , "d" : 0 , "e" : 20 , "f" : 21 }
31
31
32
32
for column , kind in columns .items ():
33
33
colX = dfX .get_column_by_name (column )
@@ -41,15 +41,15 @@ def test_float_int(df_from_dict):
41
41
42
42
43
43
def test_na_float (df_from_dict ):
44
- df = df_from_dict ({'a' : [1.0 , math .nan , 2.0 ]})
44
+ df = df_from_dict ({"a" : [1.0 , math .nan , 2.0 ]})
45
45
dfX = df .__dataframe__ ()
46
- colX = dfX .get_column_by_name ('a' )
46
+ colX = dfX .get_column_by_name ("a" )
47
47
assert colX .null_count == 1
48
48
49
49
def test_noncategorical (df_from_dict ):
50
- df = df_from_dict ({'a' : [1 , 2 , 3 ]})
50
+ df = df_from_dict ({"a" : [1 , 2 , 3 ]})
51
51
dfX = df .__dataframe__ ()
52
- colX = dfX .get_column_by_name ('a' )
52
+ colX = dfX .get_column_by_name ("a" )
53
53
with pytest .raises (TypeError ):
54
54
colX .describe_categorical
55
55
@@ -103,7 +103,7 @@ def test_buffer(df_from_dict):
103
103
colX = dfX .get_column (0 )
104
104
bufX = colX .get_buffers ()
105
105
106
- dataBuf , dataDtype = bufX [' data' ]
106
+ dataBuf , dataDtype = bufX [" data" ]
107
107
108
108
assert dataBuf .bufsize > 0
109
109
assert dataBuf .ptr != 0
0 commit comments