From 3ad5f3e235e3bff43d7e6894728a7fa875ac980c Mon Sep 17 00:00:00 2001 From: gfyoung Date: Thu, 22 Jun 2017 21:38:40 -0700 Subject: [PATCH] MAINT: Drop Index.sym_diff Deprecated in 0.18.1 xref gh-12591, gh-12594 --- doc/source/whatsnew/v0.21.0.txt | 1 + pandas/core/indexes/base.py | 2 -- pandas/tests/indexes/common.py | 6 +----- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt index 9d330cf3fdf2d6..74763dbc1c71a6 100644 --- a/doc/source/whatsnew/v0.21.0.txt +++ b/doc/source/whatsnew/v0.21.0.txt @@ -75,6 +75,7 @@ Removal of prior version deprecations/changes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :func:`read_excel()` has dropped the ``has_index_names`` parameter (:issue:`10967`) +- ``Index`` has dropped the ``.sym_diff()`` method in favor of ``.symmetric_difference()`` (:issue:`12591`) - ``Categorical`` has dropped the ``.order()`` and ``.sort()`` methods in favor of ``.sort_values()`` (:issue:`12882`) diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 028464ad5cd899..9dc92f4dd02432 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -2376,8 +2376,6 @@ def symmetric_difference(self, other, result_name=None): attribs['freq'] = None return self._shallow_copy_with_infer(the_diff, **attribs) - sym_diff = deprecate('sym_diff', symmetric_difference) - def _get_unique_index(self, dropna=False): """ Returns an index containing unique values. diff --git a/pandas/tests/indexes/common.py b/pandas/tests/indexes/common.py index bbde902fb87bf0..a6177104d62731 100644 --- a/pandas/tests/indexes/common.py +++ b/pandas/tests/indexes/common.py @@ -656,11 +656,7 @@ def test_symmetric_difference(self): if isinstance(idx, MultiIndex): msg = "other must be a MultiIndex or a list of tuples" with tm.assert_raises_regex(TypeError, msg): - result = first.symmetric_difference([1, 2, 3]) - - # 12591 deprecated - with tm.assert_produces_warning(FutureWarning): - first.sym_diff(second) + first.symmetric_difference([1, 2, 3]) def test_insert_base(self):