@@ -340,7 +340,7 @@ def test_corr_cov_independent_index_column(self):
340
340
assert result .index .equals (result .columns )
341
341
342
342
def test_corr_invalid_method (self ):
343
- # GH PR # 22298
343
+ # GH 22298
344
344
df = pd .DataFrame (np .random .normal (size = (10 , 2 )))
345
345
msg = ("method must be either 'pearson', 'spearman', "
346
346
"or 'kendall'" )
@@ -548,8 +548,8 @@ def test_describe_categorical(self):
548
548
549
549
cat = Series (Categorical (["a" , "b" , "c" , "c" ]))
550
550
df3 = DataFrame ({"cat" : cat , "s" : ["a" , "b" , "c" , "c" ]})
551
- res = df3 .describe ()
552
- tm .assert_numpy_array_equal (res ["cat" ].values , res ["s" ].values )
551
+ result = df3 .describe ()
552
+ tm .assert_numpy_array_equal (result ["cat" ].values , result ["s" ].values )
553
553
554
554
def test_describe_categorical_columns (self ):
555
555
# GH 11558
@@ -620,8 +620,8 @@ def test_describe_timedelta_values(self):
620
620
index = ['count' , 'mean' , 'std' , 'min' , '25%' ,
621
621
'50%' , '75%' , 'max' ])
622
622
623
- res = df .describe ()
624
- tm .assert_frame_equal (res , expected )
623
+ result = df .describe ()
624
+ tm .assert_frame_equal (result , expected )
625
625
626
626
exp_repr = (" t1 t2\n "
627
627
"count 5 5\n "
@@ -632,7 +632,7 @@ def test_describe_timedelta_values(self):
632
632
"50% 3 days 00:00:00 0 days 03:00:00\n "
633
633
"75% 4 days 00:00:00 0 days 04:00:00\n "
634
634
"max 5 days 00:00:00 0 days 05:00:00" )
635
- assert repr (res ) == exp_repr
635
+ assert repr (result ) == exp_repr
636
636
637
637
def test_describe_tz_values (self , tz_naive_fixture ):
638
638
# GH 21332
@@ -653,8 +653,8 @@ def test_describe_tz_values(self, tz_naive_fixture):
653
653
'last' , 'mean' , 'std' , 'min' , '25%' , '50%' ,
654
654
'75%' , 'max' ]
655
655
)
656
- res = df .describe (include = 'all' )
657
- tm .assert_frame_equal (res , expected )
656
+ result = df .describe (include = 'all' )
657
+ tm .assert_frame_equal (result , expected )
658
658
659
659
def test_reduce_mixed_frame (self ):
660
660
# GH 6806
@@ -684,7 +684,7 @@ def test_count(self, float_frame_with_na, float_frame, float_string_frame):
684
684
ct2 = frame .count (0 )
685
685
assert isinstance (ct2 , Series )
686
686
687
- # GH # 423
687
+ # GH 423
688
688
df = DataFrame (index = lrange (10 ))
689
689
result = df .count (1 )
690
690
expected = Series (0 , index = df .index )
@@ -731,7 +731,7 @@ def test_sum(self, float_frame_with_na, mixed_float_frame,
731
731
@pytest .mark .parametrize ('method' , ['sum' , 'mean' , 'prod' , 'var' ,
732
732
'std' , 'skew' , 'min' , 'max' ])
733
733
def test_stat_operators_attempt_obj_array (self , method ):
734
- # GH # 676
734
+ # GH 676
735
735
data = {
736
736
'a' : [- 0.00049987540199591344 , - 0.0016467257772919831 ,
737
737
0.00067695870775883013 ],
@@ -873,7 +873,7 @@ def test_var_std(self, float_frame_with_na, datetime_frame, float_frame,
873
873
@pytest .mark .parametrize (
874
874
"meth" , ['sem' , 'var' , 'std' ])
875
875
def test_numeric_only_flag (self , meth ):
876
- # GH # 9201
876
+ # GH 9201
877
877
df1 = DataFrame (np .random .randn (5 , 3 ), columns = ['foo' , 'bar' , 'baz' ])
878
878
# set one entry to a number in str format
879
879
df1 .loc [0 , 'foo' ] = '100'
@@ -1438,12 +1438,12 @@ def test_any_all_extra(self):
1438
1438
(np .any , {'A' : pd .Series ([1 , 2 ], dtype = 'category' )}, True ),
1439
1439
1440
1440
# # Mix
1441
- # GH- 21484
1441
+ # GH 21484
1442
1442
# (np.all, {'A': pd.Series([10, 20], dtype='M8[ns]'),
1443
1443
# 'B': pd.Series([10, 20], dtype='m8[ns]')}, True),
1444
1444
])
1445
1445
def test_any_all_np_func (self , func , data , expected ):
1446
- # https://github.com/pandas-dev/pandas/issues/ 19976
1446
+ # GH 19976
1447
1447
data = DataFrame (data )
1448
1448
result = func (data )
1449
1449
assert isinstance (result , np .bool_ )
@@ -1455,7 +1455,7 @@ def test_any_all_np_func(self, func, data, expected):
1455
1455
assert result .item () is expected
1456
1456
1457
1457
def test_any_all_object (self ):
1458
- # https://github.com/pandas-dev/pandas/issues/ 19976
1458
+ # GH 19976
1459
1459
result = np .all (DataFrame (columns = ['a' , 'b' ])).item ()
1460
1460
assert result is True
1461
1461
@@ -1477,7 +1477,7 @@ def test_any_all_level_axis_none_raises(self, method):
1477
1477
# Isin
1478
1478
1479
1479
def test_isin (self ):
1480
- # GH # 4211
1480
+ # GH 4211
1481
1481
df = DataFrame ({'vals' : [1 , 2 , 3 , 4 ], 'ids' : ['a' , 'b' , 'f' , 'n' ],
1482
1482
'ids2' : ['a' , 'n' , 'c' , 'n' ]},
1483
1483
index = ['foo' , 'bar' , 'baz' , 'qux' ])
@@ -1489,7 +1489,7 @@ def test_isin(self):
1489
1489
1490
1490
@pytest .mark .parametrize ("empty" , [[], Series (), np .array ([])])
1491
1491
def test_isin_empty (self , empty ):
1492
- # see gh- 16991
1492
+ # GH 16991
1493
1493
df = DataFrame ({'A' : ['a' , 'b' , 'c' ], 'B' : ['a' , 'e' , 'f' ]})
1494
1494
expected = DataFrame (False , df .index , df .columns )
1495
1495
@@ -1515,7 +1515,7 @@ def test_isin_dict(self):
1515
1515
tm .assert_frame_equal (result , expected )
1516
1516
1517
1517
def test_isin_with_string_scalar (self ):
1518
- # GH4763
1518
+ # GH 4763
1519
1519
df = DataFrame ({'vals' : [1 , 2 , 3 , 4 ], 'ids' : ['a' , 'b' , 'f' , 'n' ],
1520
1520
'ids2' : ['a' , 'n' , 'c' , 'n' ]},
1521
1521
index = ['foo' , 'bar' , 'baz' , 'qux' ])
@@ -1541,7 +1541,7 @@ def test_isin_df(self):
1541
1541
tm .assert_frame_equal (result , expected )
1542
1542
1543
1543
def test_isin_tuples (self ):
1544
- # GH16394
1544
+ # GH 16394
1545
1545
df = pd .DataFrame ({'A' : [1 , 2 , 3 ], 'B' : ['a' , 'b' , 'f' ]})
1546
1546
df ['C' ] = list (zip (df ['A' ], df ['B' ]))
1547
1547
result = df ['C' ].isin ([(1 , 'a' )])
@@ -1751,7 +1751,7 @@ def test_round(self):
1751
1751
expected_rounded ['col1' ])
1752
1752
1753
1753
def test_numpy_round (self ):
1754
- # See gh- 12600
1754
+ # GH 12600
1755
1755
df = DataFrame ([[1.53 , 1.36 ], [0.06 , 7.01 ]])
1756
1756
out = np .round (df , decimals = 0 )
1757
1757
expected = DataFrame ([[2. , 1. ], [0. , 7. ]])
@@ -1762,7 +1762,7 @@ def test_numpy_round(self):
1762
1762
np .round (df , decimals = 0 , out = df )
1763
1763
1764
1764
def test_round_mixed_type (self ):
1765
- # GH11885
1765
+ # GH 11885
1766
1766
df = DataFrame ({'col1' : [1.1 , 2.2 , 3.3 , 4.4 ],
1767
1767
'col2' : ['1' , 'a' , 'c' , 'f' ],
1768
1768
'col3' : date_range ('20111111' , periods = 4 )})
@@ -1777,7 +1777,7 @@ def test_round_mixed_type(self):
1777
1777
tm .assert_frame_equal (df .round ({'col3' : 1 }), df )
1778
1778
1779
1779
def test_round_issue (self ):
1780
- # GH11611
1780
+ # GH 11611
1781
1781
1782
1782
df = pd .DataFrame (np .random .random ([3 , 3 ]), columns = ['A' , 'B' , 'C' ],
1783
1783
index = ['first' , 'second' , 'third' ])
@@ -1794,7 +1794,7 @@ def test_built_in_round(self):
1794
1794
pytest .skip ("build in round cannot be overridden "
1795
1795
"prior to Python 3" )
1796
1796
1797
- # GH11763
1797
+ # GH 11763
1798
1798
# Here's the test frame we'll be working with
1799
1799
df = DataFrame (
1800
1800
{'col1' : [1.123 , 2.123 , 3.123 ], 'col2' : [1.234 , 2.234 , 3.234 ]})
@@ -1838,7 +1838,7 @@ def test_clip(self, float_frame):
1838
1838
assert (float_frame .values == original .values ).all ()
1839
1839
1840
1840
def test_inplace_clip (self , float_frame ):
1841
- # GH # 15388
1841
+ # GH 15388
1842
1842
median = float_frame .median ().median ()
1843
1843
frame_copy = float_frame .copy ()
1844
1844
@@ -1854,7 +1854,7 @@ def test_inplace_clip(self, float_frame):
1854
1854
assert not (frame_copy .values != median ).any ()
1855
1855
1856
1856
def test_dataframe_clip (self ):
1857
- # GH # 2747
1857
+ # GH 2747
1858
1858
df = DataFrame (np .random .randn (1000 , 2 ))
1859
1859
1860
1860
for lb , ub in [(- 1 , 1 ), (1 , - 1 )]:
@@ -1881,7 +1881,7 @@ def test_clip_mixed_numeric(self):
1881
1881
1882
1882
@pytest .mark .parametrize ("inplace" , [True , False ])
1883
1883
def test_clip_against_series (self , inplace ):
1884
- # GH # 6966
1884
+ # GH 6966
1885
1885
1886
1886
df = DataFrame (np .random .randn (1000 , 2 ))
1887
1887
lb = Series (np .random .randn (1000 ))
@@ -1916,7 +1916,7 @@ def test_clip_against_series(self, inplace):
1916
1916
])
1917
1917
def test_clip_against_list_like (self , simple_frame ,
1918
1918
inplace , lower , axis , res ):
1919
- # GH # 15390
1919
+ # GH 15390
1920
1920
original = simple_frame .copy (deep = True )
1921
1921
1922
1922
result = original .clip (lower = lower , upper = [5 , 6 , 7 ],
@@ -1947,12 +1947,12 @@ def test_clip_against_frame(self, axis):
1947
1947
1948
1948
def test_clip_with_na_args (self , float_frame ):
1949
1949
"""Should process np.nan argument as None """
1950
- # GH # 17276
1950
+ # GH 17276
1951
1951
tm .assert_frame_equal (float_frame .clip (np .nan ), float_frame )
1952
1952
tm .assert_frame_equal (float_frame .clip (upper = np .nan , lower = np .nan ),
1953
1953
float_frame )
1954
1954
1955
- # GH # 19992
1955
+ # GH 19992
1956
1956
df = DataFrame ({'col_0' : [1 , 2 , 3 ], 'col_1' : [4 , 5 , 6 ],
1957
1957
'col_2' : [7 , 8 , 9 ]})
1958
1958
@@ -2025,7 +2025,7 @@ def test_dot(self):
2025
2025
_np_version_under1p12 ,
2026
2026
reason = "unpredictable return types under numpy < 1.12" )
2027
2027
def test_matmul (self ):
2028
- # matmul test is for GH # 10259
2028
+ # matmul test is for GH 10259
2029
2029
a = DataFrame (np .random .randn (3 , 4 ), index = ['a' , 'b' , 'c' ],
2030
2030
columns = ['p' , 'q' , 'r' , 's' ])
2031
2031
b = DataFrame (np .random .randn (4 , 2 ), index = ['p' , 'q' , 'r' , 's' ],
@@ -2139,7 +2139,7 @@ class TestNLargestNSmallest(object):
2139
2139
['b' , 'c' , 'c' ]])
2140
2140
@pytest .mark .parametrize ('n' , range (1 , 11 ))
2141
2141
def test_n (self , df_strings , nselect_method , n , order ):
2142
- # GH10393
2142
+ # GH 10393
2143
2143
df = df_strings
2144
2144
if 'b' in order :
2145
2145
@@ -2190,7 +2190,7 @@ def test_duplicates_on_starter_columns(self, method, expected):
2190
2190
tm .assert_frame_equal (result , expected )
2191
2191
2192
2192
def test_n_identical_values (self ):
2193
- # GH15297
2193
+ # GH 15297
2194
2194
df = pd .DataFrame ({'a' : [1 ] * 5 , 'b' : [1 , 2 , 3 , 4 , 5 ]})
2195
2195
2196
2196
result = df .nlargest (3 , 'a' )
@@ -2224,7 +2224,7 @@ def test_n_duplicate_index(self, df_duplicates, n, order):
2224
2224
tm .assert_frame_equal (result , expected )
2225
2225
2226
2226
def test_duplicate_keep_all_ties (self ):
2227
- # see gh- 16818
2227
+ # GH 16818
2228
2228
df = pd .DataFrame ({'a' : [5 , 4 , 4 , 2 , 3 , 3 , 3 , 3 ],
2229
2229
'b' : [10 , 9 , 8 , 7 , 5 , 50 , 10 , 20 ]})
2230
2230
result = df .nlargest (4 , 'a' , keep = 'all' )
0 commit comments