@@ -59,7 +59,7 @@ def test_apply(self, float_frame):
59
59
[[1 , 2 , 3 ], [4 , 5 , 6 ], [7 , 8 , 9 ]], index = ['a' , 'a' , 'c' ])
60
60
pytest .raises (ValueError , df .apply , lambda x : x , 2 )
61
61
62
- # see gh- 9573
62
+ # GH 9573
63
63
df = DataFrame ({'c0' : ['A' , 'A' , 'B' , 'B' ],
64
64
'c1' : ['C' , 'C' , 'D' , 'D' ]})
65
65
df = df .apply (lambda ts : ts .astype ('category' ))
@@ -94,7 +94,7 @@ def test_apply_empty(self, float_frame, empty_frame):
94
94
expected = Series (np .nan , index = float_frame .index )
95
95
assert_series_equal (result , expected )
96
96
97
- # 2476
97
+ # GH 2476
98
98
expected = DataFrame (index = ['a' ])
99
99
result = expected .apply (lambda x : x ['a' ], axis = 1 )
100
100
assert_frame_equal (expected , result )
@@ -468,11 +468,11 @@ def test_applymap(self, float_frame):
468
468
tm .assert_frame_equal (applied , float_frame * 2 )
469
469
float_frame .applymap (type )
470
470
471
- # gh- 465: function returning tuples
471
+ # GH 465: function returning tuples
472
472
result = float_frame .applymap (lambda x : (x , x ))
473
473
assert isinstance (result ['A' ][0 ], tuple )
474
474
475
- # gh- 2909: object conversion to float in constructor?
475
+ # GH 2909: object conversion to float in constructor?
476
476
df = DataFrame (data = [1 , 'a' ])
477
477
result = df .applymap (lambda x : x )
478
478
assert result .dtypes [0 ] == object
@@ -481,7 +481,7 @@ def test_applymap(self, float_frame):
481
481
result = df .applymap (lambda x : x )
482
482
assert result .dtypes [0 ] == object
483
483
484
- # see gh- 2786
484
+ # GH 2786
485
485
df = DataFrame (np .random .random ((3 , 4 )))
486
486
df2 = df .copy ()
487
487
cols = ['a' , 'a' , 'a' , 'a' ]
@@ -499,7 +499,7 @@ def test_applymap(self, float_frame):
499
499
for f in ['datetime' , 'timedelta' ]:
500
500
assert result .loc [0 , f ] == str (df .loc [0 , f ])
501
501
502
- # see gh- 8222
502
+ # GH 8222
503
503
empty_frames = [pd .DataFrame (),
504
504
pd .DataFrame (columns = list ('ABC' )),
505
505
pd .DataFrame (index = list ('ABC' )),
@@ -510,7 +510,7 @@ def test_applymap(self, float_frame):
510
510
tm .assert_frame_equal (result , frame )
511
511
512
512
def test_applymap_box_timestamps (self ):
513
- # # 2689, # 2627
513
+ # GH 2689, GH 2627
514
514
ser = pd .Series (date_range ('1/1/2000' , periods = 10 ))
515
515
516
516
def func (x ):
@@ -547,7 +547,7 @@ def test_frame_apply_dont_convert_datetime64(self):
547
547
assert df .x1 .dtype == 'M8[ns]'
548
548
549
549
def test_apply_non_numpy_dtype (self ):
550
- # See gh- 12244
550
+ # GH 12244
551
551
df = DataFrame ({'dt' : pd .date_range (
552
552
"2015-01-01" , periods = 3 , tz = 'Europe/Brussels' )})
553
553
result = df .apply (lambda x : x )
@@ -577,7 +577,7 @@ class TestInferOutputShape(object):
577
577
# us to infer the output
578
578
579
579
def test_infer_row_shape (self ):
580
- # gh- 17437
580
+ # GH 17437
581
581
# if row shape is changing, infer it
582
582
df = pd .DataFrame (np .random .rand (10 , 2 ))
583
583
result = df .apply (np .fft .fft , axis = 0 )
@@ -587,7 +587,7 @@ def test_infer_row_shape(self):
587
587
assert result .shape == (6 , 2 )
588
588
589
589
def test_with_dictlike_columns (self ):
590
- # gh 17602
590
+ # GH 17602
591
591
df = DataFrame ([[1 , 2 ], [1 , 2 ]], columns = ['a' , 'b' ])
592
592
result = df .apply (lambda x : {'s' : x ['a' ] + x ['b' ]},
593
593
axis = 1 )
@@ -605,7 +605,7 @@ def test_with_dictlike_columns(self):
605
605
expected = Series ([{'s' : 3 }, {'s' : 3 }])
606
606
assert_series_equal (result , expected )
607
607
608
- # gh- 18775
608
+ # GH 18775
609
609
df = DataFrame ()
610
610
df ["author" ] = ["X" , "Y" , "Z" ]
611
611
df ["publisher" ] = ["BBC" , "NBC" , "N24" ]
@@ -617,7 +617,7 @@ def test_with_dictlike_columns(self):
617
617
assert_series_equal (result , expected )
618
618
619
619
def test_with_dictlike_columns_with_infer (self ):
620
- # gh 17602
620
+ # GH 17602
621
621
df = DataFrame ([[1 , 2 ], [1 , 2 ]], columns = ['a' , 'b' ])
622
622
result = df .apply (lambda x : {'s' : x ['a' ] + x ['b' ]},
623
623
axis = 1 , result_type = 'expand' )
@@ -631,7 +631,7 @@ def test_with_dictlike_columns_with_infer(self):
631
631
assert_frame_equal (result , expected )
632
632
633
633
def test_with_listlike_columns (self ):
634
- # gh- 17348
634
+ # GH 17348
635
635
df = DataFrame ({'a' : Series (np .random .randn (4 )),
636
636
'b' : ['a' , 'list' , 'of' , 'words' ],
637
637
'ts' : date_range ('2016-10-01' , periods = 4 , freq = 'H' )})
@@ -644,7 +644,7 @@ def test_with_listlike_columns(self):
644
644
expected = Series ([t [1 :] for t in df [['a' , 'ts' ]].itertuples ()])
645
645
assert_series_equal (result , expected )
646
646
647
- # gh- 18919
647
+ # GH 18919
648
648
df = DataFrame ({'x' : Series ([['a' , 'b' ], ['q' ]]),
649
649
'y' : Series ([['z' ], ['q' , 't' ]])})
650
650
df .index = MultiIndex .from_tuples ([('i0' , 'j0' ), ('i1' , 'j1' )])
@@ -656,7 +656,7 @@ def test_with_listlike_columns(self):
656
656
assert_series_equal (result , expected )
657
657
658
658
def test_infer_output_shape_columns (self ):
659
- # gh- 18573
659
+ # GH 18573
660
660
661
661
df = DataFrame ({'number' : [1. , 2. ],
662
662
'string' : ['foo' , 'bar' ],
@@ -667,7 +667,7 @@ def test_infer_output_shape_columns(self):
667
667
assert_series_equal (result , expected )
668
668
669
669
def test_infer_output_shape_listlike_columns (self ):
670
- # gh- 16353
670
+ # GH 16353
671
671
672
672
df = DataFrame (np .random .randn (6 , 3 ), columns = ['A' , 'B' , 'C' ])
673
673
@@ -679,7 +679,7 @@ def test_infer_output_shape_listlike_columns(self):
679
679
expected = Series ([[1 , 2 ] for t in df .itertuples ()])
680
680
assert_series_equal (result , expected )
681
681
682
- # gh- 17970
682
+ # GH 17970
683
683
df = DataFrame ({"a" : [1 , 2 , 3 ]}, index = list ('abc' ))
684
684
685
685
result = df .apply (lambda row : np .ones (1 ), axis = 1 )
@@ -692,7 +692,7 @@ def test_infer_output_shape_listlike_columns(self):
692
692
index = df .index )
693
693
assert_series_equal (result , expected )
694
694
695
- # gh- 17892
695
+ # GH 17892
696
696
df = pd .DataFrame ({'a' : [pd .Timestamp ('2010-02-01' ),
697
697
pd .Timestamp ('2010-02-04' ),
698
698
pd .Timestamp ('2010-02-05' ),
@@ -900,7 +900,7 @@ def f():
900
900
'abs' , 'shift' , 'pct_change' , 'cumsum' , 'rank' ,
901
901
])
902
902
def test_transform_method_name (self , method ):
903
- # https://github.com/pandas-dev/pandas/issues/ 19760
903
+ # GH 19760
904
904
df = pd .DataFrame ({"A" : [- 1 , 2 ]})
905
905
result = df .transform (method )
906
906
expected = operator .methodcaller (method )(df )
@@ -924,7 +924,7 @@ def test_demo(self):
924
924
tm .assert_frame_equal (result .reindex_like (expected ), expected )
925
925
926
926
def test_agg_multiple_mixed_no_warning (self ):
927
- # https://github.com/pandas-dev/pandas/issues/ 20909
927
+ # GH 20909
928
928
mdf = pd .DataFrame ({'A' : [1 , 2 , 3 ],
929
929
'B' : [1. , 2. , 3. ],
930
930
'C' : ['foo' , 'bar' , 'baz' ],
@@ -1107,7 +1107,7 @@ def test_non_callable_aggregates(self):
1107
1107
]),
1108
1108
))
1109
1109
def test_agg_cython_table (self , df , func , expected , axis ):
1110
- # GH21224
1110
+ # GH 21224
1111
1111
# test reducing functions in
1112
1112
# pandas.core.base.SelectionMixin._cython_table
1113
1113
result = df .agg (func , axis = axis )
@@ -1126,7 +1126,7 @@ def test_agg_cython_table(self, df, func, expected, axis):
1126
1126
]),
1127
1127
))
1128
1128
def test_agg_cython_table_transform (self , df , func , expected , axis ):
1129
- # GH21224
1129
+ # GH 21224
1130
1130
# test transforming functions in
1131
1131
# pandas.core.base.SelectionMixin._cython_table (cumprod, cumsum)
1132
1132
result = df .agg (func , axis = axis )
@@ -1138,7 +1138,7 @@ def test_agg_cython_table_transform(self, df, func, expected, axis):
1138
1138
]),
1139
1139
)
1140
1140
def test_agg_cython_table_raises (self , df , func , expected , axis ):
1141
- # GH21224
1141
+ # GH 21224
1142
1142
with pytest .raises (expected ):
1143
1143
df .agg (func , axis = axis )
1144
1144
@@ -1157,7 +1157,7 @@ def indices(draw, max_length=5):
1157
1157
1158
1158
@given (index = indices (5 ), num_columns = integers (0 , 5 ))
1159
1159
def test_frequency_is_original (self , index , num_columns ):
1160
- # GH22150
1160
+ # GH 22150
1161
1161
original = index .copy ()
1162
1162
df = DataFrame (True , index = index , columns = range (num_columns ))
1163
1163
df .apply (lambda x : x )
0 commit comments