Skip to content

Commit 4dd740a

Browse files
committed
MAINT: Drop Index.sym_diff
Deprecated in 0.18.1 xref pandas-devgh-12591, pandas-devgh-12594
1 parent 18f7b1c commit 4dd740a

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

doc/source/whatsnew/v0.21.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Removal of prior version deprecations/changes
7575
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7676

7777
- :func:`read_excel()` has dropped the ``has_index_names`` parameter (:issue:`10967`)
78+
- ``Index`` has dropped the ``.sym_diff()`` method in favor of ``.symmetric_difference()`` (:issue:`12591`)
7879
- ``Categorical`` has dropped the ``.order()`` and ``.sort()`` methods in favor of ``.sort_values()`` (:issue:`12882`)
7980

8081

pandas/core/indexes/base.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141

4242
from pandas.core.base import PandasObject, IndexOpsMixin
4343
import pandas.core.base as base
44-
from pandas.util._decorators import (Appender, Substitution, cache_readonly,
45-
deprecate, deprecate_kwarg)
44+
from pandas.util._decorators import (Appender, Substitution,
45+
cache_readonly, deprecate_kwarg)
4646
from pandas.core.indexes.frozen import FrozenList
4747
import pandas.core.common as com
4848
import pandas.core.dtypes.concat as _concat
@@ -2376,8 +2376,6 @@ def symmetric_difference(self, other, result_name=None):
23762376
attribs['freq'] = None
23772377
return self._shallow_copy_with_infer(the_diff, **attribs)
23782378

2379-
sym_diff = deprecate('sym_diff', symmetric_difference)
2380-
23812379
def _get_unique_index(self, dropna=False):
23822380
"""
23832381
Returns an index containing unique values.

pandas/tests/indexes/common.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -656,11 +656,7 @@ def test_symmetric_difference(self):
656656
if isinstance(idx, MultiIndex):
657657
msg = "other must be a MultiIndex or a list of tuples"
658658
with tm.assert_raises_regex(TypeError, msg):
659-
result = first.symmetric_difference([1, 2, 3])
660-
661-
# 12591 deprecated
662-
with tm.assert_produces_warning(FutureWarning):
663-
first.sym_diff(second)
659+
first.symmetric_difference([1, 2, 3])
664660

665661
def test_insert_base(self):
666662

0 commit comments

Comments
 (0)