@@ -272,7 +272,7 @@ def test_corr_cov_independent_index_column(self):
272
272
assert result .index .equals (result .columns )
273
273
274
274
def test_corr_invalid_method (self ):
275
- # GH PR # 22298
275
+ # GH 22298
276
276
df = DataFrame (np .random .normal (size = (10 , 2 )))
277
277
msg = ("method must be either 'pearson', 'spearman', "
278
278
"or 'kendall'" )
@@ -616,7 +616,7 @@ def test_count(self, float_frame_with_na, float_frame, float_string_frame):
616
616
ct2 = frame .count (0 )
617
617
assert isinstance (ct2 , Series )
618
618
619
- # GH # 423
619
+ # GH 423
620
620
df = DataFrame (index = lrange (10 ))
621
621
result = df .count (1 )
622
622
expected = Series (0 , index = df .index )
@@ -663,7 +663,7 @@ def test_sum(self, float_frame_with_na, mixed_float_frame,
663
663
@pytest .mark .parametrize ('method' , ['sum' , 'mean' , 'prod' , 'var' ,
664
664
'std' , 'skew' , 'min' , 'max' ])
665
665
def test_stat_operators_attempt_obj_array (self , method ):
666
- # GH # 676
666
+ # GH 676
667
667
data = {
668
668
'a' : [- 0.00049987540199591344 , - 0.0016467257772919831 ,
669
669
0.00067695870775883013 ],
@@ -805,7 +805,7 @@ def test_var_std(self, float_frame_with_na, datetime_frame, float_frame,
805
805
@pytest .mark .parametrize (
806
806
"meth" , ['sem' , 'var' , 'std' ])
807
807
def test_numeric_only_flag (self , meth ):
808
- # GH # 9201
808
+ # GH 9201
809
809
df1 = DataFrame (np .random .randn (5 , 3 ), columns = ['foo' , 'bar' , 'baz' ])
810
810
# set one entry to a number in str format
811
811
df1 .loc [0 , 'foo' ] = '100'
@@ -1371,12 +1371,12 @@ def test_any_all_extra(self):
1371
1371
(np .any , {'A' : Series ([1 , 2 ], dtype = 'category' )}, True ),
1372
1372
1373
1373
# # Mix
1374
- # GH- 21484
1374
+ # GH 21484
1375
1375
# (np.all, {'A': Series([10, 20], dtype='M8[ns]'),
1376
1376
# 'B': Series([10, 20], dtype='m8[ns]')}, True),
1377
1377
])
1378
1378
def test_any_all_np_func (self , func , data , expected ):
1379
- # https://github.com/pandas-dev/pandas/issues/ 19976
1379
+ # GH 19976
1380
1380
data = DataFrame (data )
1381
1381
result = func (data )
1382
1382
assert isinstance (result , np .bool_ )
@@ -1388,7 +1388,7 @@ def test_any_all_np_func(self, func, data, expected):
1388
1388
assert result .item () is expected
1389
1389
1390
1390
def test_any_all_object (self ):
1391
- # https://github.com/pandas-dev/pandas/issues/ 19976
1391
+ # GH 19976
1392
1392
result = np .all (DataFrame (columns = ['a' , 'b' ])).item ()
1393
1393
assert result is True
1394
1394
@@ -1410,7 +1410,7 @@ def test_any_all_level_axis_none_raises(self, method):
1410
1410
# Isin
1411
1411
1412
1412
def test_isin (self ):
1413
- # GH # 4211
1413
+ # GH 4211
1414
1414
df = DataFrame ({'vals' : [1 , 2 , 3 , 4 ], 'ids' : ['a' , 'b' , 'f' , 'n' ],
1415
1415
'ids2' : ['a' , 'n' , 'c' , 'n' ]},
1416
1416
index = ['foo' , 'bar' , 'baz' , 'qux' ])
@@ -1422,7 +1422,7 @@ def test_isin(self):
1422
1422
1423
1423
@pytest .mark .parametrize ("empty" , [[], Series (), np .array ([])])
1424
1424
def test_isin_empty (self , empty ):
1425
- # see gh- 16991
1425
+ # GH 16991
1426
1426
df = DataFrame ({'A' : ['a' , 'b' , 'c' ], 'B' : ['a' , 'e' , 'f' ]})
1427
1427
expected = DataFrame (False , df .index , df .columns )
1428
1428
@@ -1448,7 +1448,7 @@ def test_isin_dict(self):
1448
1448
tm .assert_frame_equal (result , expected )
1449
1449
1450
1450
def test_isin_with_string_scalar (self ):
1451
- # GH4763
1451
+ # GH 4763
1452
1452
df = DataFrame ({'vals' : [1 , 2 , 3 , 4 ], 'ids' : ['a' , 'b' , 'f' , 'n' ],
1453
1453
'ids2' : ['a' , 'n' , 'c' , 'n' ]},
1454
1454
index = ['foo' , 'bar' , 'baz' , 'qux' ])
@@ -1474,7 +1474,7 @@ def test_isin_df(self):
1474
1474
tm .assert_frame_equal (result , expected )
1475
1475
1476
1476
def test_isin_tuples (self ):
1477
- # GH16394
1477
+ # GH 16394
1478
1478
df = DataFrame ({'A' : [1 , 2 , 3 ], 'B' : ['a' , 'b' , 'f' ]})
1479
1479
df ['C' ] = list (zip (df ['A' ], df ['B' ]))
1480
1480
result = df ['C' ].isin ([(1 , 'a' )])
@@ -1682,7 +1682,7 @@ def test_round(self):
1682
1682
expected_rounded ['col1' ])
1683
1683
1684
1684
def test_numpy_round (self ):
1685
- # See 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
- # GH11885
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
- # GH11611
1711
+ # GH 11611
1712
1712
1713
1713
df = 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
- # GH11763
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 ]})
@@ -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 ],
@@ -1877,12 +1877,12 @@ def test_clip_against_frame(self, axis):
1877
1877
1878
1878
def test_clip_with_na_args (self , float_frame ):
1879
1879
"""Should process np.nan argument as None """
1880
- # GH # 17276
1880
+ # GH 17276
1881
1881
tm .assert_frame_equal (float_frame .clip (np .nan ), float_frame )
1882
1882
tm .assert_frame_equal (float_frame .clip (upper = np .nan , lower = np .nan ),
1883
1883
float_frame )
1884
1884
1885
- # GH # 19992
1885
+ # GH 19992
1886
1886
df = DataFrame ({'col_0' : [1 , 2 , 3 ], 'col_1' : [4 , 5 , 6 ],
1887
1887
'col_2' : [7 , 8 , 9 ]})
1888
1888
@@ -1955,7 +1955,7 @@ def test_dot(self):
1955
1955
_np_version_under1p12 ,
1956
1956
reason = "unpredictable return types under numpy < 1.12" )
1957
1957
def test_matmul (self ):
1958
- # matmul test is for GH # 10259
1958
+ # matmul test is for GH 10259
1959
1959
a = DataFrame (np .random .randn (3 , 4 ), index = ['a' , 'b' , 'c' ],
1960
1960
columns = ['p' , 'q' , 'r' , 's' ])
1961
1961
b = DataFrame (np .random .randn (4 , 2 ), index = ['p' , 'q' , 'r' , 's' ],
@@ -2069,7 +2069,7 @@ class TestNLargestNSmallest(object):
2069
2069
['b' , 'c' , 'c' ]])
2070
2070
@pytest .mark .parametrize ('n' , range (1 , 11 ))
2071
2071
def test_n (self , df_strings , nselect_method , n , order ):
2072
- # GH10393
2072
+ # GH 10393
2073
2073
df = df_strings
2074
2074
if 'b' in order :
2075
2075
@@ -2102,7 +2102,7 @@ def test_n_all_dtypes(self, df_main_dtypes):
2102
2102
df .nlargest (2 , list (set (df ) - {'category_string' , 'string' }))
2103
2103
2104
2104
def test_n_identical_values (self ):
2105
- # GH15297
2105
+ # GH 15297
2106
2106
df = DataFrame ({'a' : [1 ] * 5 , 'b' : [1 , 2 , 3 , 4 , 5 ]})
2107
2107
2108
2108
result = df .nlargest (3 , 'a' )
@@ -2136,7 +2136,7 @@ def test_n_duplicate_index(self, df_duplicates, n, order):
2136
2136
tm .assert_frame_equal (result , expected )
2137
2137
2138
2138
def test_duplicate_keep_all_ties (self ):
2139
- # see gh- 16818
2139
+ # GH 16818
2140
2140
df = DataFrame ({'a' : [5 , 4 , 4 , 2 , 3 , 3 , 3 , 3 ],
2141
2141
'b' : [10 , 9 , 8 , 7 , 5 , 50 , 10 , 20 ]})
2142
2142
result = df .nlargest (4 , 'a' , keep = 'all' )
0 commit comments