Skip to content

Commit

Permalink
Unify GH reference for frame/test_analytics.py
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed Sep 23, 2018
1 parent e7c0cfe commit afbebb2
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions pandas/tests/frame/test_analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def test_corr_cov_independent_index_column(self):
assert result.index.equals(result.columns)

def test_corr_invalid_method(self):
# GH PR #22298
# GH 22298
df = DataFrame(np.random.normal(size=(10, 2)))
msg = ("method must be either 'pearson', 'spearman', "
"or 'kendall'")
Expand Down Expand Up @@ -616,7 +616,7 @@ def test_count(self, float_frame_with_na, float_frame, float_string_frame):
ct2 = frame.count(0)
assert isinstance(ct2, Series)

# GH #423
# GH 423
df = DataFrame(index=lrange(10))
result = df.count(1)
expected = Series(0, index=df.index)
Expand Down Expand Up @@ -663,7 +663,7 @@ def test_sum(self, float_frame_with_na, mixed_float_frame,
@pytest.mark.parametrize('method', ['sum', 'mean', 'prod', 'var',
'std', 'skew', 'min', 'max'])
def test_stat_operators_attempt_obj_array(self, method):
# GH #676
# GH 676
data = {
'a': [-0.00049987540199591344, -0.0016467257772919831,
0.00067695870775883013],
Expand Down Expand Up @@ -805,7 +805,7 @@ def test_var_std(self, float_frame_with_na, datetime_frame, float_frame,
@pytest.mark.parametrize(
"meth", ['sem', 'var', 'std'])
def test_numeric_only_flag(self, meth):
# GH #9201
# GH 9201
df1 = DataFrame(np.random.randn(5, 3), columns=['foo', 'bar', 'baz'])
# set one entry to a number in str format
df1.loc[0, 'foo'] = '100'
Expand Down Expand Up @@ -1370,12 +1370,12 @@ def test_any_all_extra(self):
(np.any, {'A': Series([1, 2], dtype='category')}, True),
# # Mix
# GH-21484
# GH 21484
# (np.all, {'A': Series([10, 20], dtype='M8[ns]'),
# 'B': Series([10, 20], dtype='m8[ns]')}, True),
])
def test_any_all_np_func(self, func, data, expected):
# https://github.com/pandas-dev/pandas/issues/19976
# GH 19976
data = DataFrame(data)
result = func(data)
assert isinstance(result, np.bool_)
Expand All @@ -1387,7 +1387,7 @@ def test_any_all_np_func(self, func, data, expected):
assert result.item() is expected

def test_any_all_object(self):
# https://github.com/pandas-dev/pandas/issues/19976
# GH 19976
result = np.all(DataFrame(columns=['a', 'b'])).item()
assert result is True

Expand All @@ -1409,7 +1409,7 @@ def test_any_all_level_axis_none_raises(self, method):
# Isin

def test_isin(self):
# GH #4211
# GH 4211
df = DataFrame({'vals': [1, 2, 3, 4], 'ids': ['a', 'b', 'f', 'n'],
'ids2': ['a', 'n', 'c', 'n']},
index=['foo', 'bar', 'baz', 'qux'])
Expand All @@ -1421,7 +1421,7 @@ def test_isin(self):

@pytest.mark.parametrize("empty", [[], Series(), np.array([])])
def test_isin_empty(self, empty):
# see gh-16991
# GH 16991
df = DataFrame({'A': ['a', 'b', 'c'], 'B': ['a', 'e', 'f']})
expected = DataFrame(False, df.index, df.columns)

Expand All @@ -1447,7 +1447,7 @@ def test_isin_dict(self):
tm.assert_frame_equal(result, expected)

def test_isin_with_string_scalar(self):
# GH4763
# GH 4763
df = DataFrame({'vals': [1, 2, 3, 4], 'ids': ['a', 'b', 'f', 'n'],
'ids2': ['a', 'n', 'c', 'n']},
index=['foo', 'bar', 'baz', 'qux'])
Expand All @@ -1473,7 +1473,7 @@ def test_isin_df(self):
tm.assert_frame_equal(result, expected)

def test_isin_tuples(self):
# GH16394
# GH 16394
df = DataFrame({'A': [1, 2, 3], 'B': ['a', 'b', 'f']})
df['C'] = list(zip(df['A'], df['B']))
result = df['C'].isin([(1, 'a')])
Expand Down Expand Up @@ -1681,7 +1681,7 @@ def test_round(self):
expected_rounded['col1'])

def test_numpy_round(self):
# See gh-12600
# GH 12600
df = DataFrame([[1.53, 1.36], [0.06, 7.01]])
out = np.round(df, decimals=0)
expected = DataFrame([[2., 1.], [0., 7.]])
Expand All @@ -1692,7 +1692,7 @@ def test_numpy_round(self):
np.round(df, decimals=0, out=df)

def test_round_mixed_type(self):
# GH11885
# GH 11885
df = DataFrame({'col1': [1.1, 2.2, 3.3, 4.4],
'col2': ['1', 'a', 'c', 'f'],
'col3': date_range('20111111', periods=4)})
Expand All @@ -1707,7 +1707,7 @@ def test_round_mixed_type(self):
tm.assert_frame_equal(df.round({'col3': 1}), df)

def test_round_issue(self):
# GH11611
# GH 11611

df = DataFrame(np.random.random([3, 3]), columns=['A', 'B', 'C'],
index=['first', 'second', 'third'])
Expand All @@ -1724,7 +1724,7 @@ def test_built_in_round(self):
pytest.skip("build in round cannot be overridden "
"prior to Python 3")

# GH11763
# GH 11763
# Here's the test frame we'll be working with
df = DataFrame(
{'col1': [1.123, 2.123, 3.123], 'col2': [1.234, 2.234, 3.234]})
Expand Down Expand Up @@ -1768,7 +1768,7 @@ def test_clip(self, float_frame):
assert (float_frame.values == original.values).all()

def test_inplace_clip(self, float_frame):
# GH #15388
# GH 15388
median = float_frame.median().median()
frame_copy = float_frame.copy()

Expand All @@ -1784,7 +1784,7 @@ def test_inplace_clip(self, float_frame):
assert not (frame_copy.values != median).any()

def test_dataframe_clip(self):
# GH #2747
# GH 2747
df = DataFrame(np.random.randn(1000, 2))

for lb, ub in [(-1, 1), (1, -1)]:
Expand All @@ -1811,7 +1811,7 @@ def test_clip_mixed_numeric(self):

@pytest.mark.parametrize("inplace", [True, False])
def test_clip_against_series(self, inplace):
# GH #6966
# GH 6966

df = DataFrame(np.random.randn(1000, 2))
lb = Series(np.random.randn(1000))
Expand Down Expand Up @@ -1846,7 +1846,7 @@ def test_clip_against_series(self, inplace):
])
def test_clip_against_list_like(self, simple_frame,
inplace, lower, axis, res):
# GH #15390
# GH 15390
original = simple_frame.copy(deep=True)

result = original.clip(lower=lower, upper=[5, 6, 7],
Expand Down Expand Up @@ -1876,12 +1876,12 @@ def test_clip_against_frame(self, axis):

def test_clip_with_na_args(self, float_frame):
"""Should process np.nan argument as None """
# GH # 17276
# GH 17276
tm.assert_frame_equal(float_frame.clip(np.nan), float_frame)
tm.assert_frame_equal(float_frame.clip(upper=np.nan, lower=np.nan),
float_frame)

# GH #19992
# GH 19992
df = DataFrame({'col_0': [1, 2, 3], 'col_1': [4, 5, 6],
'col_2': [7, 8, 9]})

Expand Down Expand Up @@ -1954,7 +1954,7 @@ def test_dot(self):
_np_version_under1p12,
reason="unpredictable return types under numpy < 1.12")
def test_matmul(self):
# matmul test is for GH #10259
# matmul test is for GH 10259
a = DataFrame(np.random.randn(3, 4), index=['a', 'b', 'c'],
columns=['p', 'q', 'r', 's'])
b = DataFrame(np.random.randn(4, 2), index=['p', 'q', 'r', 's'],
Expand Down Expand Up @@ -2068,7 +2068,7 @@ class TestNLargestNSmallest(object):
['b', 'c', 'c']])
@pytest.mark.parametrize('n', range(1, 11))
def test_n(self, df_strings, nselect_method, n, order):
# GH10393
# GH 10393
df = df_strings
if 'b' in order:

Expand Down Expand Up @@ -2101,7 +2101,7 @@ def test_n_all_dtypes(self, df_main_dtypes):
df.nlargest(2, list(set(df) - {'category_string', 'string'}))

def test_n_identical_values(self):
# GH15297
# GH 15297
df = DataFrame({'a': [1] * 5, 'b': [1, 2, 3, 4, 5]})

result = df.nlargest(3, 'a')
Expand Down Expand Up @@ -2135,7 +2135,7 @@ def test_n_duplicate_index(self, df_duplicates, n, order):
tm.assert_frame_equal(result, expected)

def test_duplicate_keep_all_ties(self):
# see gh-16818
# GH 16818
df = DataFrame({'a': [5, 4, 4, 2, 3, 3, 3, 3],
'b': [10, 9, 8, 7, 5, 50, 10, 20]})
result = df.nlargest(4, 'a', keep='all')
Expand Down

0 comments on commit afbebb2

Please sign in to comment.