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