From 733b889ee5eb77aa3764298db5d261b3b4f2c767 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 23 Sep 2018 23:47:21 +0200 Subject: [PATCH] Revert "Change GH reference formatting (review jreback)" This reverts commit 855a1866a240629cde8cb9a31306c4d8fdc92317. --- pandas/tests/frame/test_analytics.py | 82 +++++++++++++-------------- pandas/tests/frame/test_api.py | 14 ++--- pandas/tests/frame/test_apply.py | 60 ++++++++++---------- pandas/tests/frame/test_arithmetic.py | 20 +++---- 4 files changed, 88 insertions(+), 88 deletions(-) diff --git a/pandas/tests/frame/test_analytics.py b/pandas/tests/frame/test_analytics.py index 6f1713eb72348..827a817534dd9 100644 --- a/pandas/tests/frame/test_analytics.py +++ b/pandas/tests/frame/test_analytics.py @@ -262,7 +262,7 @@ def test_corr_int_and_boolean(self): tm.assert_frame_equal(result, expected) def test_corr_cov_independent_index_column(self): - # gh-14617 + # GH 14617 df = pd.DataFrame(np.random.randn(4 * 10).reshape(10, 4), columns=list("abcd")) for method in ['cov', 'corr']: @@ -271,7 +271,7 @@ def test_corr_cov_independent_index_column(self): assert result.index.equals(result.columns) def test_corr_invalid_method(self): - # gh-22298 + # GH 22298 df = pd. DataFrame(np.random.normal(size=(10, 2))) msg = ("method must be either 'pearson', 'spearman', " "or 'kendall'") @@ -387,7 +387,7 @@ def test_corrwith_matches_corrcoef(self): assert c1 < 1 def test_corrwith_mixed_dtypes(self): - # gh-18570 + # GH 18570 df = pd.DataFrame({'a': [1, 4, 3, 2], 'b': [4, 6, 7, 3], 'c': ['a', 'b', 'c', 'd']}) s = pd.Series([0, 6, 7, 3]) @@ -420,7 +420,7 @@ def test_bool_describe_in_mixed_frame(self): tm.assert_frame_equal(result, expected) def test_describe_bool_frame(self): - # gh-13891 + # GH 13891 df = pd.DataFrame({ 'bool_data_1': [False, False, True, True], 'bool_data_2': [False, True, True, True] @@ -483,7 +483,7 @@ def test_describe_categorical(self): tm.assert_numpy_array_equal(result["cat"].values, result["s"].values) def test_describe_categorical_columns(self): - # gh-11558 + # GH 11558 columns = pd.CategoricalIndex(['int1', 'int2', 'obj'], ordered=True, name='XXX') df = DataFrame({'int1': [10, 20, 30, 40, 50], @@ -529,7 +529,7 @@ def test_describe_datetime_columns(self): assert result.columns.tz == expected.columns.tz def test_describe_timedelta_values(self): - # gh-6145 + # GH 6145 t1 = pd.timedelta_range('1 days', freq='D', periods=5) t2 = pd.timedelta_range('1 hours', freq='H', periods=5) df = pd.DataFrame({'t1': t1, 't2': t2}) @@ -566,7 +566,7 @@ def test_describe_timedelta_values(self): assert repr(result) == exp_repr def test_describe_tz_values(self, tz_naive_fixture): - # gh-21332 + # GH 21332 tz = tz_naive_fixture s1 = Series(range(5)) start = Timestamp(2018, 1, 1) @@ -588,7 +588,7 @@ def test_describe_tz_values(self, tz_naive_fixture): tm.assert_frame_equal(result, expected) def test_reduce_mixed_frame(self): - # gh-6806 + # GH 6806 df = DataFrame({ 'bool_data': [True, True, False, False, False], 'int_data': [10, 20, 30, 40, 50], @@ -615,7 +615,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) @@ -662,7 +662,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], @@ -804,7 +804,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' @@ -830,7 +830,7 @@ def test_numeric_only_flag(self, meth): @pytest.mark.parametrize('op', ['mean', 'std', 'var', 'skew', 'kurt', 'sem']) def test_mixed_ops(self, op): - # gh-16116 + # GH 16116 df = DataFrame({'int': [1, 2, 3, 4], 'float': [1., 2., 3., 4.], 'str': ['a', 'b', 'c', 'd']}) @@ -1086,7 +1086,7 @@ def test_operators_timedelta64(self): timedelta(days=-1)], index=['A', 'B']) tm.assert_series_equal(result, expected) - # gh-3106 + # GH 3106 df = DataFrame({'time': date_range('20130102', periods=5), 'time2': date_range('20130105', periods=5)}) df['off1'] = df['time2'] - df['time'] @@ -1369,12 +1369,12 @@ def test_any_all_extra(self): (np.any, {'A': pd.Series([1, 2], dtype='category')}, True), # # Mix - # gh-21484 + # GH 21484 # (np.all, {'A': pd.Series([10, 20], dtype='M8[ns]'), # 'B': pd.Series([10, 20], dtype='m8[ns]')}, True), ]) def test_any_all_np_func(self, func, data, expected): - # gh-19976 + # GH 19976 data = DataFrame(data) result = func(data) assert isinstance(result, np.bool_) @@ -1386,7 +1386,7 @@ def test_any_all_np_func(self, func, data, expected): assert result.item() is expected def test_any_all_object(self): - # gh-19976 + # GH 19976 result = np.all(DataFrame(columns=['a', 'b'])).item() assert result is True @@ -1408,7 +1408,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']) @@ -1420,7 +1420,7 @@ def test_isin(self): @pytest.mark.parametrize("empty", [[], Series(), np.array([])]) def test_isin_empty(self, empty): - # gh-16991 + # GH 16991 df = DataFrame({'A': ['a', 'b', 'c'], 'B': ['a', 'e', 'f']}) expected = DataFrame(False, df.index, df.columns) @@ -1446,7 +1446,7 @@ def test_isin_dict(self): tm.assert_frame_equal(result, expected) def test_isin_with_string_scalar(self): - # gh-4763 + # GH 4763 df = DataFrame({'vals': [1, 2, 3, 4], 'ids': ['a', 'b', 'f', 'n'], 'ids2': ['a', 'n', 'c', 'n']}, index=['foo', 'bar', 'baz', 'qux']) @@ -1472,7 +1472,7 @@ def test_isin_df(self): tm.assert_frame_equal(result, expected) def test_isin_tuples(self): - # gh-16394 + # GH 16394 df = pd.DataFrame({'A': [1, 2, 3], 'B': ['a', 'b', 'f']}) df['C'] = list(zip(df['A'], df['B'])) result = df['C'].isin([(1, 'a')]) @@ -1542,7 +1542,7 @@ def test_isin_multiIndex(self): tm.assert_frame_equal(result, expected) def test_isin_empty_datetimelike(self): - # gh-15473 + # GH 15473 df1_ts = DataFrame({'date': pd.to_datetime(['2014-01-01', '2014-01-02'])}) df1_td = DataFrame({'date': @@ -1564,7 +1564,7 @@ def test_isin_empty_datetimelike(self): # Rounding def test_round(self): - # gh-2665 + # GH 2665 # Test that rounding an empty DataFrame does nothing df = DataFrame() @@ -1667,7 +1667,7 @@ def test_round(self): tm.assert_series_equal(df['col1'].round(1), expected_rounded['col1']) # named columns - # gh-11986 + # GH 11986 decimals = 2 expected_rounded = DataFrame( {'col1': [1.12, 2.12, 3.12], 'col2': [1.23, 2.23, 3.23]}) @@ -1682,7 +1682,7 @@ def test_round(self): expected_rounded['col1']) def test_numpy_round(self): - # 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.]]) @@ -1693,7 +1693,7 @@ def test_numpy_round(self): np.round(df, decimals=0, out=df) def test_round_mixed_type(self): - # gh-11885 + # GH 11885 df = DataFrame({'col1': [1.1, 2.2, 3.3, 4.4], 'col2': ['1', 'a', 'c', 'f'], 'col3': date_range('20111111', periods=4)}) @@ -1708,7 +1708,7 @@ def test_round_mixed_type(self): tm.assert_frame_equal(df.round({'col3': 1}), df) def test_round_issue(self): - # gh-11611 + # GH 11611 df = pd.DataFrame(np.random.random([3, 3]), columns=['A', 'B', 'C'], index=['first', 'second', 'third']) @@ -1725,7 +1725,7 @@ def test_built_in_round(self): pytest.skip("build in round cannot be overridden " "prior to Python 3") - # gh-11763 + # 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]}) @@ -1736,7 +1736,7 @@ def test_built_in_round(self): tm.assert_frame_equal(round(df), expected_rounded) def test_pct_change(self): - # gh-11150 + # GH 11150 pnl = DataFrame([np.arange(0, 40, 10), np.arange(0, 40, 10), np.arange( 0, 40, 10)]).astype(np.float64) pnl.iat[1, 0] = np.nan @@ -1769,7 +1769,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() @@ -1785,7 +1785,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)]: @@ -1812,7 +1812,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)) @@ -1847,7 +1847,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], @@ -1878,12 +1878,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]}) @@ -1956,7 +1956,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'], @@ -2070,7 +2070,7 @@ class TestNLargestNSmallest(object): ['b', 'c', 'c']]) @pytest.mark.parametrize('n', range(1, 11)) def test_n(self, df_strings, nselect_method, n, order): - # gh-10393 + # GH 10393 df = df_strings if 'b' in order: @@ -2103,7 +2103,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): - # gh-15297 + # GH 15297 df = pd.DataFrame({'a': [1] * 5, 'b': [1, 2, 3, 4, 5]}) result = df.nlargest(3, 'a') @@ -2125,7 +2125,7 @@ def test_n_identical_values(self): ['c', 'b']]) @pytest.mark.parametrize('n', range(1, 6)) def test_n_duplicate_index(self, df_duplicates, n, order): - # gh-13412 + # GH 13412 df = df_duplicates result = df.nsmallest(n, order) @@ -2137,7 +2137,7 @@ def test_n_duplicate_index(self, df_duplicates, n, order): tm.assert_frame_equal(result, expected) def test_duplicate_keep_all_ties(self): - # gh-16818 + # GH 16818 df = pd.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') @@ -2154,7 +2154,7 @@ def test_duplicate_keep_all_ties(self): def test_series_broadcasting(self): # smoke test for numpy warnings - # gh-16378, gh-16306 + # GH 16378, GH 16306 df = DataFrame([1.0, 1.0, 1.0]) df_nan = DataFrame({'A': [np.nan, 2.0, np.nan]}) s = Series([1, 1, 1]) @@ -2166,7 +2166,7 @@ def test_series_broadcasting(self): getattr(df, op)(s_nan, axis=0) def test_series_nat_conversion(self): - # gh-18521 + # GH 18521 # Check rank does not mutate DataFrame df = DataFrame(np.random.randn(10, 3), dtype='float64') expected = df.copy() diff --git a/pandas/tests/frame/test_api.py b/pandas/tests/frame/test_api.py index 87ea3f63f5a16..4b4296e4abc16 100644 --- a/pandas/tests/frame/test_api.py +++ b/pandas/tests/frame/test_api.py @@ -192,7 +192,7 @@ def test_iteritems(self): assert isinstance(v, self.klass._constructor_sliced) def test_items(self): - # gh-17213, gh-13918 + # GH 17213, GH 13918 cols = ['a', 'b', 'c'] df = DataFrame([[1, 2, 3], [4, 5, 6]], columns=cols) for c, (k, v) in zip(cols, df.items()): @@ -213,7 +213,7 @@ def test_iterrows(self, float_frame, float_string_frame): self._assert_series_equal(v, exp) def test_iterrows_iso8601(self): - # gh-19671 + # GH 19671 if self.klass == SparseDataFrame: pytest.xfail(reason='SparseBlock datetime type not implemented.') @@ -266,7 +266,7 @@ def test_itertuples(self, float_frame): def test_sequence_like_with_categorical(self): - # gh-7839 + # GH 7839 # make sure can iterate df = DataFrame({"id": [1, 2, 3, 4, 5, 6], "raw_grade": ['a', 'b', 'b', 'a', 'a', 'e']}) @@ -354,7 +354,7 @@ def test_axis_aliases(self, float_frame): assert_series_equal(result, expected) def test_class_axis(self): - # gh-18147 + # GH 18147 # no exception and no empty docstring assert pydoc.getdoc(DataFrame.index) assert pydoc.getdoc(DataFrame.columns) @@ -418,7 +418,7 @@ def test_values(self, float_frame): assert (float_frame.values[:, 0] == 5).all() def test_as_matrix_deprecated(self, float_frame): - # gh-18458 + # GH 18458 with tm.assert_produces_warning(FutureWarning): cols = float_frame.columns.tolist() result = float_frame.as_matrix(columns=cols) @@ -439,7 +439,7 @@ def test_transpose_get_view(self, float_frame): assert (float_frame.values[5:10] == 5).all() def test_inplace_return_self(self): - # gh-1893 + # GH 1893 data = DataFrame({'a': ['foo', 'bar', 'baz', 'qux'], 'b': [0, 0, 1, 1], @@ -503,7 +503,7 @@ def _check_f(base, f): _check_f(d.copy(), f) def test_tab_complete_warning(self, ip): - # gh-16409 + # GH 16409 pytest.importorskip('IPython', minversion="6.0.0") from IPython.core.completer import provisionalcompleter diff --git a/pandas/tests/frame/test_apply.py b/pandas/tests/frame/test_apply.py index 4f5bdc999b7bc..ca3469f34fee6 100644 --- a/pandas/tests/frame/test_apply.py +++ b/pandas/tests/frame/test_apply.py @@ -59,7 +59,7 @@ def test_apply(self, float_frame): [[1, 2, 3], [4, 5, 6], [7, 8, 9]], index=['a', 'a', 'c']) pytest.raises(ValueError, df.apply, lambda x: x, 2) - # gh-9573 + # GH 9573 df = DataFrame({'c0': ['A', 'A', 'B', 'B'], 'c1': ['C', 'C', 'D', 'D']}) df = df.apply(lambda ts: ts.astype('category')) @@ -70,7 +70,7 @@ def test_apply(self, float_frame): def test_apply_mixed_datetimelike(self): # mixed datetimelike - # gh-7778 + # GH 7778 df = DataFrame({'A': date_range('20130101', periods=3), 'B': pd.to_timedelta(np.arange(3), unit='s')}) result = df.apply(lambda x: x, axis=1) @@ -94,7 +94,7 @@ def test_apply_empty(self, float_frame, empty_frame): expected = Series(np.nan, index=float_frame.index) assert_series_equal(result, expected) - # gh-2476 + # GH 2476 expected = DataFrame(index=['a']) result = expected.apply(lambda x: x['a'], axis=1) assert_frame_equal(expected, result) @@ -371,7 +371,7 @@ def transform2(row): def test_apply_bug(self): - # gh-6125 + # GH 6125 positions = pd.DataFrame([[1, 'ABC0', 50], [1, 'YUM0', 20], [1, 'DEF0', 20], [2, 'ABC1', 50], [2, 'YUM1', 20], [2, 'DEF1', 20]], @@ -446,7 +446,7 @@ def test_apply_multi_index(self, float_frame): def test_apply_dict(self): - # gh-8735 + # GH 8735 A = DataFrame([['foo', 'bar'], ['spam', 'eggs']]) A_dicts = Series([dict([(0, 'foo'), (1, 'spam')]), dict([(0, 'bar'), (1, 'eggs')])]) @@ -468,11 +468,11 @@ def test_applymap(self, float_frame): tm.assert_frame_equal(applied, float_frame * 2) float_frame.applymap(type) - # gh-465: function returning tuples + # GH 465: function returning tuples result = float_frame.applymap(lambda x: (x, x)) assert isinstance(result['A'][0], tuple) - # gh-2909: object conversion to float in constructor? + # GH 2909: object conversion to float in constructor? df = DataFrame(data=[1, 'a']) result = df.applymap(lambda x: x) assert result.dtypes[0] == object @@ -481,7 +481,7 @@ def test_applymap(self, float_frame): result = df.applymap(lambda x: x) assert result.dtypes[0] == object - # gh-2786 + # GH 2786 df = DataFrame(np.random.random((3, 4))) df2 = df.copy() cols = ['a', 'a', 'a', 'a'] @@ -499,7 +499,7 @@ def test_applymap(self, float_frame): for f in ['datetime', 'timedelta']: assert result.loc[0, f] == str(df.loc[0, f]) - # gh-8222 + # GH 8222 empty_frames = [pd.DataFrame(), pd.DataFrame(columns=list('ABC')), pd.DataFrame(index=list('ABC')), @@ -510,7 +510,7 @@ def test_applymap(self, float_frame): tm.assert_frame_equal(result, frame) def test_applymap_box_timestamps(self): - # gh-2689, gh-2627 + # GH 2689, GH 2627 ser = pd.Series(date_range('1/1/2000', periods=10)) def func(x): @@ -547,7 +547,7 @@ def test_frame_apply_dont_convert_datetime64(self): assert df.x1.dtype == 'M8[ns]' def test_apply_non_numpy_dtype(self): - # gh-12244 + # GH 12244 df = DataFrame({'dt': pd.date_range( "2015-01-01", periods=3, tz='Europe/Brussels')}) result = df.apply(lambda x: x) @@ -563,7 +563,7 @@ def test_apply_non_numpy_dtype(self): assert_frame_equal(result, df) def test_apply_dup_names_multi_agg(self): - # gh-21063 + # GH 21063 df = pd.DataFrame([[0, 1], [2, 3]], columns=['a', 'a']) expected = pd.DataFrame([[0, 1]], columns=['a', 'a'], index=['min']) result = df.agg(['min']) @@ -577,7 +577,7 @@ class TestInferOutputShape(object): # us to infer the output def test_infer_row_shape(self): - # gh-17437 + # GH 17437 # if row shape is changing, infer it df = pd.DataFrame(np.random.rand(10, 2)) result = df.apply(np.fft.fft, axis=0) @@ -587,7 +587,7 @@ def test_infer_row_shape(self): assert result.shape == (6, 2) def test_with_dictlike_columns(self): - # gh-17602 + # GH 17602 df = DataFrame([[1, 2], [1, 2]], columns=['a', 'b']) result = df.apply(lambda x: {'s': x['a'] + x['b']}, axis=1) @@ -605,7 +605,7 @@ def test_with_dictlike_columns(self): expected = Series([{'s': 3}, {'s': 3}]) assert_series_equal(result, expected) - # gh-18775 + # GH 18775 df = DataFrame() df["author"] = ["X", "Y", "Z"] df["publisher"] = ["BBC", "NBC", "N24"] @@ -617,7 +617,7 @@ def test_with_dictlike_columns(self): assert_series_equal(result, expected) def test_with_dictlike_columns_with_infer(self): - # gh-17602 + # GH 17602 df = DataFrame([[1, 2], [1, 2]], columns=['a', 'b']) result = df.apply(lambda x: {'s': x['a'] + x['b']}, axis=1, result_type='expand') @@ -631,7 +631,7 @@ def test_with_dictlike_columns_with_infer(self): assert_frame_equal(result, expected) def test_with_listlike_columns(self): - # gh-17348 + # GH 17348 df = DataFrame({'a': Series(np.random.randn(4)), 'b': ['a', 'list', 'of', 'words'], 'ts': date_range('2016-10-01', periods=4, freq='H')}) @@ -644,7 +644,7 @@ def test_with_listlike_columns(self): expected = Series([t[1:] for t in df[['a', 'ts']].itertuples()]) assert_series_equal(result, expected) - # gh-18919 + # GH 18919 df = DataFrame({'x': Series([['a', 'b'], ['q']]), 'y': Series([['z'], ['q', 't']])}) df.index = MultiIndex.from_tuples([('i0', 'j0'), ('i1', 'j1')]) @@ -656,7 +656,7 @@ def test_with_listlike_columns(self): assert_series_equal(result, expected) def test_infer_output_shape_columns(self): - # gh-18573 + # GH 18573 df = DataFrame({'number': [1., 2.], 'string': ['foo', 'bar'], @@ -667,7 +667,7 @@ def test_infer_output_shape_columns(self): assert_series_equal(result, expected) def test_infer_output_shape_listlike_columns(self): - # gh-16353 + # GH 16353 df = DataFrame(np.random.randn(6, 3), columns=['A', 'B', 'C']) @@ -679,7 +679,7 @@ def test_infer_output_shape_listlike_columns(self): expected = Series([[1, 2] for t in df.itertuples()]) assert_series_equal(result, expected) - # gh-17970 + # GH 17970 df = DataFrame({"a": [1, 2, 3]}, index=list('abc')) result = df.apply(lambda row: np.ones(1), axis=1) @@ -692,7 +692,7 @@ def test_infer_output_shape_listlike_columns(self): index=df.index) assert_series_equal(result, expected) - # gh-17892 + # GH 17892 df = pd.DataFrame({'a': [pd.Timestamp('2010-02-01'), pd.Timestamp('2010-02-04'), pd.Timestamp('2010-02-05'), @@ -900,7 +900,7 @@ def f(): 'abs', 'shift', 'pct_change', 'cumsum', 'rank', ]) def test_transform_method_name(self, method): - # gh-19760 + # GH 19760 df = pd.DataFrame({"A": [-1, 2]}) result = df.transform(method) expected = operator.methodcaller(method)(df) @@ -924,7 +924,7 @@ def test_demo(self): tm.assert_frame_equal(result.reindex_like(expected), expected) def test_agg_multiple_mixed_no_warning(self): - # gh-20909 + # GH 20909 mdf = pd.DataFrame({'A': [1, 2, 3], 'B': [1., 2., 3.], 'C': ['foo', 'bar', 'baz'], @@ -1007,7 +1007,7 @@ def test_agg_reduce(self, axis, float_frame): def test_nuiscance_columns(self): - # gh-15015 + # GH 15015 df = DataFrame({'A': [1, 2, 3], 'B': [1., 2., 3.], 'C': ['foo', 'bar', 'baz'], @@ -1035,7 +1035,7 @@ def test_nuiscance_columns(self): def test_non_callable_aggregates(self): - # gh-16405 + # GH 16405 # 'size' is a property of frame/series # validate that this is working df = DataFrame({'A': [None, 2, 3], @@ -1107,7 +1107,7 @@ def test_non_callable_aggregates(self): ]), )) def test_agg_cython_table(self, df, func, expected, axis): - # gh-21224 + # GH 21224 # test reducing functions in # pandas.core.base.SelectionMixin._cython_table result = df.agg(func, axis=axis) @@ -1126,7 +1126,7 @@ def test_agg_cython_table(self, df, func, expected, axis): ]), )) def test_agg_cython_table_transform(self, df, func, expected, axis): - # gh-21224 + # GH 21224 # test transforming functions in # pandas.core.base.SelectionMixin._cython_table (cumprod, cumsum) result = df.agg(func, axis=axis) @@ -1138,7 +1138,7 @@ def test_agg_cython_table_transform(self, df, func, expected, axis): ]), ) def test_agg_cython_table_raises(self, df, func, expected, axis): - # gh-21224 + # GH 21224 with pytest.raises(expected): df.agg(func, axis=axis) @@ -1157,7 +1157,7 @@ def indices(draw, max_length=5): @given(index=indices(5), num_columns=integers(0, 5)) def test_frequency_is_original(self, index, num_columns): - # gh-22150 + # GH 22150 original = index.copy() df = DataFrame(True, index=index, columns=range(num_columns)) df.apply(lambda x: x) diff --git a/pandas/tests/frame/test_arithmetic.py b/pandas/tests/frame/test_arithmetic.py index 7584fd92b9f96..f955206062a5a 100644 --- a/pandas/tests/frame/test_arithmetic.py +++ b/pandas/tests/frame/test_arithmetic.py @@ -17,7 +17,7 @@ class TestFrameComparisons(object): def test_flex_comparison_nat(self): - # gh-15697, gh-22163 df.eq(pd.NaT) should behave like df == pd.NaT, + # GH 15697, GH 22163 df.eq(pd.NaT) should behave like df == pd.NaT, # and _definitely_ not be NaN df = pd.DataFrame([pd.NaT]) @@ -35,7 +35,7 @@ def test_flex_comparison_nat(self): assert result.iloc[0, 0].item() is True def test_mixed_comparison(self): - # gh-13128, gh-22163 != datetime64 vs non-dt64 should be False, + # GH 13128, GH 22163 != datetime64 vs non-dt64 should be False, # not raise TypeError # (this appears to be fixed before #22163, not sure when) df = pd.DataFrame([['1989-08-01', 1], ['1989-08-01', 2]]) @@ -48,7 +48,7 @@ def test_mixed_comparison(self): assert result.all().all() def test_df_boolean_comparison_error(self): - # gh-4576 + # GH 4576 # boolean comparisons with a tuple/list give unexpected results df = pd.DataFrame(np.arange(6).reshape((3, 2))) @@ -77,7 +77,7 @@ def test_df_string_comparison(self): @pytest.mark.parametrize('opname', ['eq', 'ne', 'gt', 'lt', 'ge', 'le']) def test_df_flex_cmp_constant_return_types(self, opname): - # gh-15077, non-empty DataFrame + # GH 15077, non-empty DataFrame df = pd.DataFrame({'x': [1, 2, 3], 'y': [1., 2., 3.]}) const = 2 @@ -86,7 +86,7 @@ def test_df_flex_cmp_constant_return_types(self, opname): @pytest.mark.parametrize('opname', ['eq', 'ne', 'gt', 'lt', 'ge', 'le']) def test_df_flex_cmp_constant_return_types_empty(self, opname): - # gh-15077 empty DataFrame + # GH 15077 empty DataFrame df = pd.DataFrame({'x': [1, 2, 3], 'y': [1., 2., 3.]}) const = 2 @@ -100,7 +100,7 @@ def test_df_flex_cmp_constant_return_types_empty(self, opname): class TestFrameFlexArithmetic(object): def test_df_add_td64_columnwise(self): - # gh-22534 Check that column-wise addition broadcasts correctly + # GH 22534 Check that column-wise addition broadcasts correctly dti = pd.date_range('2016-01-01', periods=10) tdi = pd.timedelta_range('1', periods=10) tser = pd.Series(tdi) @@ -112,7 +112,7 @@ def test_df_add_td64_columnwise(self): tm.assert_frame_equal(result, expected) def test_df_add_flex_filled_mixed_dtypes(self): - # gh-19611 + # GH 19611 dti = pd.date_range('2016-01-01', periods=3) ser = pd.Series(['1 Day', 'NaT', '2 Days'], dtype='timedelta64[ns]') df = pd.DataFrame({'A': dti, 'B': ser}) @@ -224,7 +224,7 @@ def test_arith_flex_series(self, simple_frame): tm.assert_frame_equal(df.div(row), df / row) tm.assert_frame_equal(df.div(col, axis=0), (df.T / col).T) - # broadcasting issue in gh-7325 + # broadcasting issue in GH 7325 df = pd.DataFrame(np.arange(3 * 2).reshape((3, 2)), dtype='int64') expected = pd.DataFrame([[np.nan, np.inf], [1.0, 1.5], [1.0, 1.25]]) result = df.div(df[0], axis='index') @@ -236,7 +236,7 @@ def test_arith_flex_series(self, simple_frame): tm.assert_frame_equal(result, expected) def test_arith_flex_zero_len_raises(self): - # gh-19522 passing fill_value to frame flex arith methods should + # GH 19522 passing fill_value to frame flex arith methods should # raise even in the zero-length special cases ser_len0 = pd.Series([]) df_len0 = pd.DataFrame([], columns=['A', 'B']) @@ -251,7 +251,7 @@ def test_arith_flex_zero_len_raises(self): class TestFrameArithmetic(object): def test_df_bool_mul_int(self): - # gh-22047, gh-22163 multiplication by 1 should result in int dtype, + # GH 22047, GH 22163 multiplication by 1 should result in int dtype, # not object dtype df = pd.DataFrame([[False, True], [False, False]]) result = df * 1