File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,28 @@ 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 ):
121
+ """
122
+ Find indices where elements of v should be inserted
123
+ in a to maintain order.
124
+
125
+ For full documentation, see `numpy.searchsorted`
126
+
127
+ See Also
128
+ --------
129
+ numpy.searchsorted : equivalent function
130
+ Type: method_descriptor
131
+ """
132
+
133
+ # we are much more performant if we have the same
134
+ # type as the indexer
135
+ try :
136
+ v = self .dtype .type (v )
137
+ except :
138
+ pass
139
+ return super (FrozenNDArray , self ).searchsorted (
140
+ v , side = side , sorter = sorter )
141
+
120
142
121
143
def _ensure_frozen (array_like , categories , copy = False ):
122
144
array_like = coerce_indexer_dtype (array_like , categories )
You can’t perform that action at this time.
0 commit comments