@@ -103,19 +103,6 @@ def _get_prev_label(label):
103
103
raise TypeError (f"cannot determine next label for type { repr (type (label ))} " )
104
104
105
105
106
- def _get_interval_closed_bounds (interval ):
107
- """
108
- Given an Interval or IntervalIndex, return the corresponding interval with
109
- closed bounds.
110
- """
111
- left , right = interval .left , interval .right
112
- if interval .open_left :
113
- left = _get_next_label (left )
114
- if interval .open_right :
115
- right = _get_prev_label (right )
116
- return left , right
117
-
118
-
119
106
def _new_IntervalIndex (cls , d ):
120
107
"""
121
108
This is called upon unpickling, rather than the default which doesn't have
@@ -675,26 +662,6 @@ def _convert_list_indexer(self, keyarr, kind=None):
675
662
676
663
return locs
677
664
678
- def _maybe_cast_indexed (self , key ):
679
- """
680
- we need to cast the key, which could be a scalar
681
- or an array-like to the type of our subtype
682
- """
683
- if isinstance (key , IntervalIndex ):
684
- return key
685
-
686
- subtype = self .dtype .subtype
687
- if is_float_dtype (subtype ):
688
- if is_integer (key ):
689
- key = float (key )
690
- elif isinstance (key , (np .ndarray , Index )):
691
- key = key .astype ("float64" )
692
- elif is_integer_dtype (subtype ):
693
- if is_integer (key ):
694
- key = int (key )
695
-
696
- return key
697
-
698
665
def _can_reindex (self , indexer : np .ndarray ) -> None :
699
666
"""
700
667
Check if we are allowing reindexing with this particular indexer.
@@ -827,34 +794,6 @@ def _searchsorted_monotonic(self, label, side, exclude_label=False):
827
794
828
795
return sub_idx ._searchsorted_monotonic (label , side )
829
796
830
- def _find_non_overlapping_monotonic_bounds (self , key ):
831
- if isinstance (key , IntervalMixin ):
832
- start = self ._searchsorted_monotonic (
833
- key .left , "left" , exclude_label = key .open_left
834
- )
835
- stop = self ._searchsorted_monotonic (
836
- key .right , "right" , exclude_label = key .open_right
837
- )
838
- elif isinstance (key , slice ):
839
- # slice
840
- start , stop = key .start , key .stop
841
- if (key .step or 1 ) != 1 :
842
- raise NotImplementedError ("cannot slice with a slice step" )
843
- if start is None :
844
- start = 0
845
- else :
846
- start = self ._searchsorted_monotonic (start , "left" )
847
- if stop is None :
848
- stop = len (self )
849
- else :
850
- stop = self ._searchsorted_monotonic (stop , "right" )
851
- else :
852
- # scalar or index-like
853
-
854
- start = self ._searchsorted_monotonic (key , "left" )
855
- stop = self ._searchsorted_monotonic (key , "right" )
856
- return start , stop
857
-
858
797
def get_loc (
859
798
self , key : Any , method : Optional [str ] = None , tolerance = None
860
799
) -> Union [int , slice , np .ndarray ]:
0 commit comments