@@ -117,10 +117,9 @@ def __unicode__(self):
117
117
quote_strings = True )
118
118
return "%s(%s, dtype='%s')" % (type (self ).__name__ , prepr , self .dtype )
119
119
120
- def searchsorted (self , v , side = ' left' , sorter = None ):
120
+ def searchsorted (self , value , side = " left" , sorter = None ):
121
121
"""
122
- Find indices where elements of v should be inserted
123
- in a to maintain order.
122
+ Find indices to insert `value` so as to maintain order.
124
123
125
124
For full documentation, see `numpy.searchsorted`
126
125
@@ -129,17 +128,20 @@ def searchsorted(self, v, side='left', sorter=None):
129
128
numpy.searchsorted : equivalent function
130
129
"""
131
130
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
131
+ # We are much more performant if the searched
132
+ # indexer is the same type as the array.
133
+ #
134
+ # This doesn't matter for int64, but DOES
135
135
# matter for smaller int dtypes
136
- # https://github.com/numpy/numpy/issues/5370
136
+ #
137
+ # xref: https://github.com/numpy/numpy/issues/5370
137
138
try :
138
- v = self .dtype .type (v )
139
+ value = self .dtype .type (value )
139
140
except :
140
141
pass
142
+
141
143
return super (FrozenNDArray , self ).searchsorted (
142
- v , side = side , sorter = sorter )
144
+ value , side = side , sorter = sorter )
143
145
144
146
145
147
def _ensure_frozen (array_like , categories , copy = False ):
0 commit comments