1010
1111import numpy as np
1212from pandas .core .base import PandasObject
13+ from pandas .util ._decorators import deprecate_kwarg
1314from pandas .core .dtypes .cast import coerce_indexer_dtype
1415from pandas .io .formats .printing import pprint_thing
1516
@@ -117,10 +118,9 @@ def __unicode__(self):
117118 quote_strings = True )
118119 return "%s(%s, dtype='%s')" % (type (self ).__name__ , prepr , self .dtype )
119120
120- def searchsorted (self , v , side = ' left' , sorter = None ):
121+ def searchsorted (self , value , side = " left" , sorter = None ):
121122 """
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.
124124
125125 For full documentation, see `numpy.searchsorted`
126126
@@ -129,17 +129,20 @@ def searchsorted(self, v, side='left', sorter=None):
129129 numpy.searchsorted : equivalent function
130130 """
131131
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
135136 # matter for smaller int dtypes
136- # https://github.com/numpy/numpy/issues/5370
137+ #
138+ # xref: https://github.com/numpy/numpy/issues/5370
137139 try :
138- v = self .dtype .type (v )
140+ value = self .dtype .type (value )
139141 except :
140142 pass
143+
141144 return super (FrozenNDArray , self ).searchsorted (
142- v , side = side , sorter = sorter )
145+ value , side = side , sorter = sorter )
143146
144147
145148def _ensure_frozen (array_like , categories , copy = False ):
0 commit comments