@@ -262,7 +262,7 @@ def test_corr_int_and_boolean(self):
262
262
tm .assert_frame_equal (result , expected )
263
263
264
264
def test_corr_cov_independent_index_column (self ):
265
- # gh- 14617
265
+ # GH 14617
266
266
df = pd .DataFrame (np .random .randn (4 * 10 ).reshape (10 , 4 ),
267
267
columns = list ("abcd" ))
268
268
for method in ['cov' , 'corr' ]:
@@ -271,7 +271,7 @@ def test_corr_cov_independent_index_column(self):
271
271
assert result .index .equals (result .columns )
272
272
273
273
def test_corr_invalid_method (self ):
274
- # gh- 22298
274
+ # GH 22298
275
275
df = pd . DataFrame (np .random .normal (size = (10 , 2 )))
276
276
msg = ("method must be either 'pearson', 'spearman', "
277
277
"or 'kendall'" )
@@ -387,7 +387,7 @@ def test_corrwith_matches_corrcoef(self):
387
387
assert c1 < 1
388
388
389
389
def test_corrwith_mixed_dtypes (self ):
390
- # gh- 18570
390
+ # GH 18570
391
391
df = pd .DataFrame ({'a' : [1 , 4 , 3 , 2 ], 'b' : [4 , 6 , 7 , 3 ],
392
392
'c' : ['a' , 'b' , 'c' , 'd' ]})
393
393
s = pd .Series ([0 , 6 , 7 , 3 ])
@@ -420,7 +420,7 @@ def test_bool_describe_in_mixed_frame(self):
420
420
tm .assert_frame_equal (result , expected )
421
421
422
422
def test_describe_bool_frame (self ):
423
- # gh- 13891
423
+ # GH 13891
424
424
df = pd .DataFrame ({
425
425
'bool_data_1' : [False , False , True , True ],
426
426
'bool_data_2' : [False , True , True , True ]
@@ -483,7 +483,7 @@ def test_describe_categorical(self):
483
483
tm .assert_numpy_array_equal (result ["cat" ].values , result ["s" ].values )
484
484
485
485
def test_describe_categorical_columns (self ):
486
- # gh- 11558
486
+ # GH 11558
487
487
columns = pd .CategoricalIndex (['int1' , 'int2' , 'obj' ],
488
488
ordered = True , name = 'XXX' )
489
489
df = DataFrame ({'int1' : [10 , 20 , 30 , 40 , 50 ],
@@ -529,7 +529,7 @@ def test_describe_datetime_columns(self):
529
529
assert result .columns .tz == expected .columns .tz
530
530
531
531
def test_describe_timedelta_values (self ):
532
- # gh- 6145
532
+ # GH 6145
533
533
t1 = pd .timedelta_range ('1 days' , freq = 'D' , periods = 5 )
534
534
t2 = pd .timedelta_range ('1 hours' , freq = 'H' , periods = 5 )
535
535
df = pd .DataFrame ({'t1' : t1 , 't2' : t2 })
@@ -566,7 +566,7 @@ def test_describe_timedelta_values(self):
566
566
assert repr (result ) == exp_repr
567
567
568
568
def test_describe_tz_values (self , tz_naive_fixture ):
569
- # gh- 21332
569
+ # GH 21332
570
570
tz = tz_naive_fixture
571
571
s1 = Series (range (5 ))
572
572
start = Timestamp (2018 , 1 , 1 )
@@ -588,7 +588,7 @@ def test_describe_tz_values(self, tz_naive_fixture):
588
588
tm .assert_frame_equal (result , expected )
589
589
590
590
def test_reduce_mixed_frame (self ):
591
- # gh- 6806
591
+ # GH 6806
592
592
df = DataFrame ({
593
593
'bool_data' : [True , True , False , False , False ],
594
594
'int_data' : [10 , 20 , 30 , 40 , 50 ],
@@ -615,7 +615,7 @@ def test_count(self, float_frame_with_na, float_frame, float_string_frame):
615
615
ct2 = frame .count (0 )
616
616
assert isinstance (ct2 , Series )
617
617
618
- # gh- 423
618
+ # GH 423
619
619
df = DataFrame (index = lrange (10 ))
620
620
result = df .count (1 )
621
621
expected = Series (0 , index = df .index )
@@ -662,7 +662,7 @@ def test_sum(self, float_frame_with_na, mixed_float_frame,
662
662
@pytest .mark .parametrize ('method' , ['sum' , 'mean' , 'prod' , 'var' ,
663
663
'std' , 'skew' , 'min' , 'max' ])
664
664
def test_stat_operators_attempt_obj_array (self , method ):
665
- # gh- 676
665
+ # GH 676
666
666
data = {
667
667
'a' : [- 0.00049987540199591344 , - 0.0016467257772919831 ,
668
668
0.00067695870775883013 ],
@@ -804,7 +804,7 @@ def test_var_std(self, float_frame_with_na, datetime_frame, float_frame,
804
804
@pytest .mark .parametrize (
805
805
"meth" , ['sem' , 'var' , 'std' ])
806
806
def test_numeric_only_flag (self , meth ):
807
- # gh- 9201
807
+ # GH 9201
808
808
df1 = DataFrame (np .random .randn (5 , 3 ), columns = ['foo' , 'bar' , 'baz' ])
809
809
# set one entry to a number in str format
810
810
df1 .loc [0 , 'foo' ] = '100'
@@ -830,7 +830,7 @@ def test_numeric_only_flag(self, meth):
830
830
@pytest .mark .parametrize ('op' , ['mean' , 'std' , 'var' ,
831
831
'skew' , 'kurt' , 'sem' ])
832
832
def test_mixed_ops (self , op ):
833
- # gh- 16116
833
+ # GH 16116
834
834
df = DataFrame ({'int' : [1 , 2 , 3 , 4 ],
835
835
'float' : [1. , 2. , 3. , 4. ],
836
836
'str' : ['a' , 'b' , 'c' , 'd' ]})
@@ -1086,7 +1086,7 @@ def test_operators_timedelta64(self):
1086
1086
timedelta (days = - 1 )], index = ['A' , 'B' ])
1087
1087
tm .assert_series_equal (result , expected )
1088
1088
1089
- # gh- 3106
1089
+ # GH 3106
1090
1090
df = DataFrame ({'time' : date_range ('20130102' , periods = 5 ),
1091
1091
'time2' : date_range ('20130105' , periods = 5 )})
1092
1092
df ['off1' ] = df ['time2' ] - df ['time' ]
@@ -1369,12 +1369,12 @@ def test_any_all_extra(self):
1369
1369
(np .any , {'A' : pd .Series ([1 , 2 ], dtype = 'category' )}, True ),
1370
1370
1371
1371
# # Mix
1372
- # gh- 21484
1372
+ # GH 21484
1373
1373
# (np.all, {'A': pd.Series([10, 20], dtype='M8[ns]'),
1374
1374
# 'B': pd.Series([10, 20], dtype='m8[ns]')}, True),
1375
1375
])
1376
1376
def test_any_all_np_func (self , func , data , expected ):
1377
- # gh- 19976
1377
+ # GH 19976
1378
1378
data = DataFrame (data )
1379
1379
result = func (data )
1380
1380
assert isinstance (result , np .bool_ )
@@ -1386,7 +1386,7 @@ def test_any_all_np_func(self, func, data, expected):
1386
1386
assert result .item () is expected
1387
1387
1388
1388
def test_any_all_object (self ):
1389
- # gh- 19976
1389
+ # GH 19976
1390
1390
result = np .all (DataFrame (columns = ['a' , 'b' ])).item ()
1391
1391
assert result is True
1392
1392
@@ -1408,7 +1408,7 @@ def test_any_all_level_axis_none_raises(self, method):
1408
1408
# Isin
1409
1409
1410
1410
def test_isin (self ):
1411
- # gh- 4211
1411
+ # GH 4211
1412
1412
df = DataFrame ({'vals' : [1 , 2 , 3 , 4 ], 'ids' : ['a' , 'b' , 'f' , 'n' ],
1413
1413
'ids2' : ['a' , 'n' , 'c' , 'n' ]},
1414
1414
index = ['foo' , 'bar' , 'baz' , 'qux' ])
@@ -1420,7 +1420,7 @@ def test_isin(self):
1420
1420
1421
1421
@pytest .mark .parametrize ("empty" , [[], Series (), np .array ([])])
1422
1422
def test_isin_empty (self , empty ):
1423
- # gh- 16991
1423
+ # GH 16991
1424
1424
df = DataFrame ({'A' : ['a' , 'b' , 'c' ], 'B' : ['a' , 'e' , 'f' ]})
1425
1425
expected = DataFrame (False , df .index , df .columns )
1426
1426
@@ -1446,7 +1446,7 @@ def test_isin_dict(self):
1446
1446
tm .assert_frame_equal (result , expected )
1447
1447
1448
1448
def test_isin_with_string_scalar (self ):
1449
- # gh- 4763
1449
+ # GH 4763
1450
1450
df = DataFrame ({'vals' : [1 , 2 , 3 , 4 ], 'ids' : ['a' , 'b' , 'f' , 'n' ],
1451
1451
'ids2' : ['a' , 'n' , 'c' , 'n' ]},
1452
1452
index = ['foo' , 'bar' , 'baz' , 'qux' ])
@@ -1472,7 +1472,7 @@ def test_isin_df(self):
1472
1472
tm .assert_frame_equal (result , expected )
1473
1473
1474
1474
def test_isin_tuples (self ):
1475
- # gh- 16394
1475
+ # GH 16394
1476
1476
df = pd .DataFrame ({'A' : [1 , 2 , 3 ], 'B' : ['a' , 'b' , 'f' ]})
1477
1477
df ['C' ] = list (zip (df ['A' ], df ['B' ]))
1478
1478
result = df ['C' ].isin ([(1 , 'a' )])
@@ -1542,7 +1542,7 @@ def test_isin_multiIndex(self):
1542
1542
tm .assert_frame_equal (result , expected )
1543
1543
1544
1544
def test_isin_empty_datetimelike (self ):
1545
- # gh- 15473
1545
+ # GH 15473
1546
1546
df1_ts = DataFrame ({'date' :
1547
1547
pd .to_datetime (['2014-01-01' , '2014-01-02' ])})
1548
1548
df1_td = DataFrame ({'date' :
@@ -1564,7 +1564,7 @@ def test_isin_empty_datetimelike(self):
1564
1564
1565
1565
# Rounding
1566
1566
def test_round (self ):
1567
- # gh- 2665
1567
+ # GH 2665
1568
1568
1569
1569
# Test that rounding an empty DataFrame does nothing
1570
1570
df = DataFrame ()
@@ -1667,7 +1667,7 @@ def test_round(self):
1667
1667
tm .assert_series_equal (df ['col1' ].round (1 ), expected_rounded ['col1' ])
1668
1668
1669
1669
# named columns
1670
- # gh- 11986
1670
+ # GH 11986
1671
1671
decimals = 2
1672
1672
expected_rounded = DataFrame (
1673
1673
{'col1' : [1.12 , 2.12 , 3.12 ], 'col2' : [1.23 , 2.23 , 3.23 ]})
@@ -1682,7 +1682,7 @@ def test_round(self):
1682
1682
expected_rounded ['col1' ])
1683
1683
1684
1684
def test_numpy_round (self ):
1685
- # gh- 12600
1685
+ # GH 12600
1686
1686
df = DataFrame ([[1.53 , 1.36 ], [0.06 , 7.01 ]])
1687
1687
out = np .round (df , decimals = 0 )
1688
1688
expected = DataFrame ([[2. , 1. ], [0. , 7. ]])
@@ -1693,7 +1693,7 @@ def test_numpy_round(self):
1693
1693
np .round (df , decimals = 0 , out = df )
1694
1694
1695
1695
def test_round_mixed_type (self ):
1696
- # gh- 11885
1696
+ # GH 11885
1697
1697
df = DataFrame ({'col1' : [1.1 , 2.2 , 3.3 , 4.4 ],
1698
1698
'col2' : ['1' , 'a' , 'c' , 'f' ],
1699
1699
'col3' : date_range ('20111111' , periods = 4 )})
@@ -1708,7 +1708,7 @@ def test_round_mixed_type(self):
1708
1708
tm .assert_frame_equal (df .round ({'col3' : 1 }), df )
1709
1709
1710
1710
def test_round_issue (self ):
1711
- # gh- 11611
1711
+ # GH 11611
1712
1712
1713
1713
df = pd .DataFrame (np .random .random ([3 , 3 ]), columns = ['A' , 'B' , 'C' ],
1714
1714
index = ['first' , 'second' , 'third' ])
@@ -1725,7 +1725,7 @@ def test_built_in_round(self):
1725
1725
pytest .skip ("build in round cannot be overridden "
1726
1726
"prior to Python 3" )
1727
1727
1728
- # gh- 11763
1728
+ # GH 11763
1729
1729
# Here's the test frame we'll be working with
1730
1730
df = DataFrame (
1731
1731
{'col1' : [1.123 , 2.123 , 3.123 ], 'col2' : [1.234 , 2.234 , 3.234 ]})
@@ -1736,7 +1736,7 @@ def test_built_in_round(self):
1736
1736
tm .assert_frame_equal (round (df ), expected_rounded )
1737
1737
1738
1738
def test_pct_change (self ):
1739
- # gh- 11150
1739
+ # GH 11150
1740
1740
pnl = DataFrame ([np .arange (0 , 40 , 10 ), np .arange (0 , 40 , 10 ), np .arange (
1741
1741
0 , 40 , 10 )]).astype (np .float64 )
1742
1742
pnl .iat [1 , 0 ] = np .nan
@@ -1769,7 +1769,7 @@ def test_clip(self, float_frame):
1769
1769
assert (float_frame .values == original .values ).all ()
1770
1770
1771
1771
def test_inplace_clip (self , float_frame ):
1772
- # gh- 15388
1772
+ # GH 15388
1773
1773
median = float_frame .median ().median ()
1774
1774
frame_copy = float_frame .copy ()
1775
1775
@@ -1785,7 +1785,7 @@ def test_inplace_clip(self, float_frame):
1785
1785
assert not (frame_copy .values != median ).any ()
1786
1786
1787
1787
def test_dataframe_clip (self ):
1788
- # gh- 2747
1788
+ # GH 2747
1789
1789
df = DataFrame (np .random .randn (1000 , 2 ))
1790
1790
1791
1791
for lb , ub in [(- 1 , 1 ), (1 , - 1 )]:
@@ -1812,7 +1812,7 @@ def test_clip_mixed_numeric(self):
1812
1812
1813
1813
@pytest .mark .parametrize ("inplace" , [True , False ])
1814
1814
def test_clip_against_series (self , inplace ):
1815
- # gh- 6966
1815
+ # GH 6966
1816
1816
1817
1817
df = DataFrame (np .random .randn (1000 , 2 ))
1818
1818
lb = Series (np .random .randn (1000 ))
@@ -1847,7 +1847,7 @@ def test_clip_against_series(self, inplace):
1847
1847
])
1848
1848
def test_clip_against_list_like (self , simple_frame ,
1849
1849
inplace , lower , axis , res ):
1850
- # gh- 15390
1850
+ # GH 15390
1851
1851
original = simple_frame .copy (deep = True )
1852
1852
1853
1853
result = original .clip (lower = lower , upper = [5 , 6 , 7 ],
@@ -1878,12 +1878,12 @@ def test_clip_against_frame(self, axis):
1878
1878
1879
1879
def test_clip_with_na_args (self , float_frame ):
1880
1880
"""Should process np.nan argument as None """
1881
- # gh- 17276
1881
+ # GH 17276
1882
1882
tm .assert_frame_equal (float_frame .clip (np .nan ), float_frame )
1883
1883
tm .assert_frame_equal (float_frame .clip (upper = np .nan , lower = np .nan ),
1884
1884
float_frame )
1885
1885
1886
- # gh- 19992
1886
+ # GH 19992
1887
1887
df = DataFrame ({'col_0' : [1 , 2 , 3 ], 'col_1' : [4 , 5 , 6 ],
1888
1888
'col_2' : [7 , 8 , 9 ]})
1889
1889
@@ -1956,7 +1956,7 @@ def test_dot(self):
1956
1956
_np_version_under1p12 ,
1957
1957
reason = "unpredictable return types under numpy < 1.12" )
1958
1958
def test_matmul (self ):
1959
- # matmul test is for gh- 10259
1959
+ # matmul test is for GH 10259
1960
1960
a = DataFrame (np .random .randn (3 , 4 ), index = ['a' , 'b' , 'c' ],
1961
1961
columns = ['p' , 'q' , 'r' , 's' ])
1962
1962
b = DataFrame (np .random .randn (4 , 2 ), index = ['p' , 'q' , 'r' , 's' ],
@@ -2070,7 +2070,7 @@ class TestNLargestNSmallest(object):
2070
2070
['b' , 'c' , 'c' ]])
2071
2071
@pytest .mark .parametrize ('n' , range (1 , 11 ))
2072
2072
def test_n (self , df_strings , nselect_method , n , order ):
2073
- # gh- 10393
2073
+ # GH 10393
2074
2074
df = df_strings
2075
2075
if 'b' in order :
2076
2076
@@ -2103,7 +2103,7 @@ def test_n_all_dtypes(self, df_main_dtypes):
2103
2103
df .nlargest (2 , list (set (df ) - {'category_string' , 'string' }))
2104
2104
2105
2105
def test_n_identical_values (self ):
2106
- # gh- 15297
2106
+ # GH 15297
2107
2107
df = pd .DataFrame ({'a' : [1 ] * 5 , 'b' : [1 , 2 , 3 , 4 , 5 ]})
2108
2108
2109
2109
result = df .nlargest (3 , 'a' )
@@ -2125,7 +2125,7 @@ def test_n_identical_values(self):
2125
2125
['c' , 'b' ]])
2126
2126
@pytest .mark .parametrize ('n' , range (1 , 6 ))
2127
2127
def test_n_duplicate_index (self , df_duplicates , n , order ):
2128
- # gh- 13412
2128
+ # GH 13412
2129
2129
2130
2130
df = df_duplicates
2131
2131
result = df .nsmallest (n , order )
@@ -2137,7 +2137,7 @@ def test_n_duplicate_index(self, df_duplicates, n, order):
2137
2137
tm .assert_frame_equal (result , expected )
2138
2138
2139
2139
def test_duplicate_keep_all_ties (self ):
2140
- # gh- 16818
2140
+ # GH 16818
2141
2141
df = pd .DataFrame ({'a' : [5 , 4 , 4 , 2 , 3 , 3 , 3 , 3 ],
2142
2142
'b' : [10 , 9 , 8 , 7 , 5 , 50 , 10 , 20 ]})
2143
2143
result = df .nlargest (4 , 'a' , keep = 'all' )
@@ -2154,7 +2154,7 @@ def test_duplicate_keep_all_ties(self):
2154
2154
2155
2155
def test_series_broadcasting (self ):
2156
2156
# smoke test for numpy warnings
2157
- # gh- 16378, gh- 16306
2157
+ # GH 16378, GH 16306
2158
2158
df = DataFrame ([1.0 , 1.0 , 1.0 ])
2159
2159
df_nan = DataFrame ({'A' : [np .nan , 2.0 , np .nan ]})
2160
2160
s = Series ([1 , 1 , 1 ])
@@ -2166,7 +2166,7 @@ def test_series_broadcasting(self):
2166
2166
getattr (df , op )(s_nan , axis = 0 )
2167
2167
2168
2168
def test_series_nat_conversion (self ):
2169
- # gh- 18521
2169
+ # GH 18521
2170
2170
# Check rank does not mutate DataFrame
2171
2171
df = DataFrame (np .random .randn (10 , 3 ), dtype = 'float64' )
2172
2172
expected = df .copy ()
0 commit comments