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