@@ -107,17 +107,14 @@ def searchsorted(
107
107
side: Literal['left', 'right']
108
108
argument controlling which index is returned if a value lands exactly on an edge.
109
109
110
- Let ``x `` be an array of rank ``N `` where ``v`` is an individual element given by ``v = x2[n,m,...,j]`` .
110
+ Let ``v `` be an element of ``x2 `` given by ``v = x2[j]``, where ``j`` refers to a valid index (see :ref:`indexing`) .
111
111
112
- If ``side == 'left'``, then
112
+ - If ``v`` is less than all elements in ``x1``, then ``out[j]`` must be ``0``.
113
+ - If ``v`` is greater than all elements in ``x1``, then ``out[j]`` must be ``M``, where ``M`` is the number of elements in ``x1``.
114
+ - Otherwise, each returned index ``i = out[j]`` must satisfy an index condition:
113
115
114
- - each returned index ``i`` must satisfy the index condition ``x1[i-1] < v <= x1[i]``.
115
- - if no index satisfies the index condition, then the returned index for that element must be ``0``.
116
-
117
- Otherwise, if ``side == 'right'``, then
118
-
119
- - each returned index ``i`` must satisfy the index condition ``x1[i-1] <= v < x1[i]``.
120
- - if no index satisfies the index condition, then the returned index for that element must be ``N``, where ``N`` is the number of elements in ``x1``.
116
+ - If ``side == 'left'``, then ``x1[i-1] < v <= x1[i]``.
117
+ - If ``side == 'right'``, then ``x1[i-1] <= v < x1[i]``.
121
118
122
119
Default: ``'left'``.
123
120
sorter: Optional[array]
0 commit comments