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,10 @@ 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+ @deprecate_kwarg (old_arg_name = "v" , new_arg_name = "value" )
122+ def searchsorted (self , value , side = "left" , sorter = None ):
121123 """
122- Find indices where elements of v should be inserted
123- in a to maintain order.
124+ Find indices to insert `value` so as to maintain order.
124125
125126 For full documentation, see `numpy.searchsorted`
126127
@@ -129,17 +130,20 @@ def searchsorted(self, v, side='left', sorter=None):
129130 numpy.searchsorted : equivalent function
130131 """
131132
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
135- # matter for smaller int dtypes
136- # https://github.com/numpy/numpy/issues/5370
133+ # We are much more performant if the searched
134+ # indexer is the same type as the array.
135+ #
136+ # This doesn't matter for int64, but DOES
137+ # matter for smaller int dtypes.
138+ #
139+ # xref: https://github.com/numpy/numpy/issues/5370
137140 try :
138- v = self .dtype .type (v )
141+ value = self .dtype .type (value )
139142 except :
140143 pass
144+
141145 return super (FrozenNDArray , self ).searchsorted (
142- v , side = side , sorter = sorter )
146+ value , side = side , sorter = sorter )
143147
144148
145149def _ensure_frozen (array_like , categories , copy = False ):
0 commit comments