19
19
20
20
class TestFrameComparisons (object ):
21
21
def test_flex_comparison_nat (self ):
22
- # GH# 15697, GH# 22163 df.eq(NaT) should behave like df == NaT,
22
+ # GH 15697, GH 22163 df.eq(NaT) should behave like df == NaT,
23
23
# and _definitely_ not be NaN
24
24
df = DataFrame ([NaT ])
25
25
@@ -37,7 +37,7 @@ def test_flex_comparison_nat(self):
37
37
assert result .iloc [0 , 0 ].item () is True
38
38
39
39
def test_mixed_comparison (self ):
40
- # GH# 13128, GH# 22163 != datetime64 vs non-dt64 should be False,
40
+ # GH 13128, GH 22163 != datetime64 vs non-dt64 should be False,
41
41
# not raise TypeError
42
42
# (this appears to be fixed before #22163, not sure when)
43
43
df = DataFrame ([['1989-08-01' , 1 ], ['1989-08-01' , 2 ]])
@@ -50,7 +50,7 @@ def test_mixed_comparison(self):
50
50
assert result .all ().all ()
51
51
52
52
def test_df_boolean_comparison_error (self ):
53
- # GH# 4576
53
+ # GH 4576
54
54
# boolean comparisons with a tuple/list give unexpected results
55
55
df = DataFrame (np .arange (6 ).reshape ((3 , 2 )))
56
56
@@ -79,7 +79,7 @@ def test_df_string_comparison(self):
79
79
80
80
@pytest .mark .parametrize ('opname' , ['eq' , 'ne' , 'gt' , 'lt' , 'ge' , 'le' ])
81
81
def test_df_flex_cmp_constant_return_types (self , opname ):
82
- # GH# 15077, non-empty DataFrame
82
+ # GH 15077, non-empty DataFrame
83
83
df = DataFrame ({'x' : [1 , 2 , 3 ], 'y' : [1. , 2. , 3. ]})
84
84
const = 2
85
85
@@ -88,7 +88,7 @@ def test_df_flex_cmp_constant_return_types(self, opname):
88
88
89
89
@pytest .mark .parametrize ('opname' , ['eq' , 'ne' , 'gt' , 'lt' , 'ge' , 'le' ])
90
90
def test_df_flex_cmp_constant_return_types_empty (self , opname ):
91
- # GH# 15077 empty DataFrame
91
+ # GH 15077 empty DataFrame
92
92
df = DataFrame ({'x' : [1 , 2 , 3 ], 'y' : [1. , 2. , 3. ]})
93
93
const = 2
94
94
@@ -102,7 +102,7 @@ def test_df_flex_cmp_constant_return_types_empty(self, opname):
102
102
103
103
class TestFrameFlexArithmetic (object ):
104
104
def test_df_add_td64_columnwise (self ):
105
- # GH# 22534 Check that column-wise addition broadcasts correctly
105
+ # GH 22534 Check that column-wise addition broadcasts correctly
106
106
dti = date_range ('2016-01-01' , periods = 10 )
107
107
tdi = timedelta_range ('1' , periods = 10 )
108
108
tser = Series (tdi )
@@ -113,7 +113,7 @@ def test_df_add_td64_columnwise(self):
113
113
tm .assert_frame_equal (result , expected )
114
114
115
115
def test_df_add_flex_filled_mixed_dtypes (self ):
116
- # GH# 19611
116
+ # GH 19611
117
117
dti = date_range ('2016-01-01' , periods = 3 )
118
118
ser = Series (['1 Day' , 'NaT' , '2 Days' ], dtype = 'timedelta64[ns]' )
119
119
df = DataFrame ({'A' : dti , 'B' : ser })
@@ -225,7 +225,7 @@ def test_arith_flex_series(self, simple_frame):
225
225
tm .assert_frame_equal (df .div (row ), df / row )
226
226
tm .assert_frame_equal (df .div (col , axis = 0 ), (df .T / col ).T )
227
227
228
- # broadcasting issue in GH# 7325
228
+ # broadcasting issue in GH 7325
229
229
df = DataFrame (np .arange (3 * 2 ).reshape ((3 , 2 )), dtype = 'int64' )
230
230
expected = DataFrame ([[np .nan , np .inf ], [1.0 , 1.5 ], [1.0 , 1.25 ]])
231
231
result = df .div (df [0 ], axis = 'index' )
@@ -237,7 +237,7 @@ def test_arith_flex_series(self, simple_frame):
237
237
tm .assert_frame_equal (result , expected )
238
238
239
239
def test_arith_flex_zero_len_raises (self ):
240
- # GH# 19522 passing fill_value to frame flex arith methods should
240
+ # GH 19522 passing fill_value to frame flex arith methods should
241
241
# raise even in the zero-length special cases
242
242
ser_len0 = Series ([])
243
243
df_len0 = DataFrame ([], columns = ['A' , 'B' ])
@@ -252,7 +252,7 @@ def test_arith_flex_zero_len_raises(self):
252
252
253
253
class TestFrameArithmetic (object ):
254
254
def test_df_bool_mul_int (self ):
255
- # GH# 22047, GH# 22163 multiplication by 1 should result in int dtype,
255
+ # GH 22047, GH 22163 multiplication by 1 should result in int dtype,
256
256
# not object dtype
257
257
df = DataFrame ([[False , True ], [False , False ]])
258
258
result = df * 1
0 commit comments