10
10
11
11
import numpy as np
12
12
from pandas .core .base import PandasObject
13
+ from pandas .util ._decorators import deprecate_kwarg
13
14
from pandas .core .dtypes .cast import coerce_indexer_dtype
14
15
from pandas .io .formats .printing import pprint_thing
15
16
@@ -117,10 +118,9 @@ def __unicode__(self):
117
118
quote_strings = True )
118
119
return "%s(%s, dtype='%s')" % (type (self ).__name__ , prepr , self .dtype )
119
120
120
- def searchsorted (self , v , side = ' left' , sorter = None ):
121
+ def searchsorted (self , value , side = " left" , sorter = None ):
121
122
"""
122
- Find indices where elements of v should be inserted
123
- in a to maintain order.
123
+ Find indices to insert `value` so as to maintain order.
124
124
125
125
For full documentation, see `numpy.searchsorted`
126
126
@@ -129,17 +129,20 @@ def searchsorted(self, v, side='left', sorter=None):
129
129
numpy.searchsorted : equivalent function
130
130
"""
131
131
132
- # we are much more performant if the searched
133
- # indexer is the same type as the array
134
- # this doesn't matter for int64, but DOES
132
+ # We are much more performant if the searched
133
+ # indexer is the same type as the array.
134
+ #
135
+ # This doesn't matter for int64, but DOES
135
136
# matter for smaller int dtypes
136
- # https://github.com/numpy/numpy/issues/5370
137
+ #
138
+ # xref: https://github.com/numpy/numpy/issues/5370
137
139
try :
138
- v = self .dtype .type (v )
140
+ value = self .dtype .type (value )
139
141
except :
140
142
pass
143
+
141
144
return super (FrozenNDArray , self ).searchsorted (
142
- v , side = side , sorter = sorter )
145
+ value , side = side , sorter = sorter )
143
146
144
147
145
148
def _ensure_frozen (array_like , categories , copy = False ):
0 commit comments