|
31 | 31 | )
|
32 | 32 | import pandas.core.common as com
|
33 | 33 | import pandas.core.indexes.base as ibase
|
34 |
| -from pandas.core.indexes.base import ensure_index, maybe_extract_name |
| 34 | +from pandas.core.indexes.base import maybe_extract_name |
35 | 35 | from pandas.core.indexes.datetimelike import DatetimeIndexOpsMixin
|
36 | 36 | from pandas.core.indexes.datetimes import DatetimeIndex, Index
|
37 | 37 | from pandas.core.indexes.extension import inherit_names
|
38 | 38 | from pandas.core.indexes.numeric import Int64Index
|
39 |
| -from pandas.core.ops import get_op_result_name |
40 | 39 |
|
41 | 40 | _index_doc_kwargs = dict(ibase._index_doc_kwargs)
|
42 | 41 | _index_doc_kwargs.update({"target_klass": "PeriodIndex or list of Periods"})
|
@@ -580,32 +579,6 @@ def _get_string_slice(self, key: str):
|
580 | 579 | except KeyError as err:
|
581 | 580 | raise KeyError(key) from err
|
582 | 581 |
|
583 |
| - # ------------------------------------------------------------------------ |
584 |
| - # Set Operation Methods |
585 |
| - |
586 |
| - def _setop(self, other, sort, opname: str): |
587 |
| - """ |
588 |
| - Perform a set operation by dispatching to the Int64Index implementation. |
589 |
| - """ |
590 |
| - self._validate_sort_keyword(sort) |
591 |
| - self._assert_can_do_setop(other) |
592 |
| - res_name = get_op_result_name(self, other) |
593 |
| - other = ensure_index(other) |
594 |
| - |
595 |
| - i8self = Int64Index._simple_new(self.asi8) |
596 |
| - i8other = Int64Index._simple_new(other.asi8) |
597 |
| - i8result = getattr(i8self, opname)(i8other, sort=sort) |
598 |
| - |
599 |
| - parr = type(self._data)(np.asarray(i8result, dtype=np.int64), dtype=self.dtype) |
600 |
| - result = type(self)._simple_new(parr, name=res_name) |
601 |
| - return result |
602 |
| - |
603 |
| - def _intersection(self, other, sort=False): |
604 |
| - return self._setop(other, sort, opname="intersection") |
605 |
| - |
606 |
| - def _union(self, other, sort): |
607 |
| - return self._setop(other, sort, opname="_union") |
608 |
| - |
609 | 582 | # ------------------------------------------------------------------------
|
610 | 583 |
|
611 | 584 | def memory_usage(self, deep: bool = False) -> int:
|
|
0 commit comments