Skip to content

Commit 87d554d

Browse files
ENH: where, searchsorted; fallbacks (#784)
1 parent 760c537 commit 87d554d

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

dpnp/dpnp_iface_searching.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@
5050

5151
__all__ = [
5252
'argmax',
53-
'argmin'
53+
'argmin',
54+
'searchsorted',
55+
'where'
5456
]
5557

5658

@@ -162,3 +164,25 @@ def argmin(x1, axis=None, out=None):
162164
return result
163165

164166
return call_origin(numpy.argmin, x1, axis, out)
167+
168+
169+
def searchsorted(a, v, side='left', sorter=None):
170+
"""
171+
Find indices where elements should be inserted to maintain order.
172+
173+
For full documentation refer to :obj:`numpy.searchsorted`.
174+
175+
"""
176+
177+
return call_origin(numpy.where, a, v, side, sorter)
178+
179+
180+
def where(condition, x=None, y=None):
181+
"""
182+
Find indices where elements should be inserted to maintain order.
183+
184+
For full documentation refer to :obj:`numpy.searchsorted`.
185+
186+
"""
187+
188+
return call_origin(numpy.where, condition, x, y)

0 commit comments

Comments
 (0)