bundles / numpy 2.4.4 / numpy / strings / rindex
function
numpy.strings:rindex
source: /numpy/_core/strings.py:370
Signature
def rindex(a, sub, start = 0, end = None)Summary
Like rfind, but raises ValueError when the substring sub is not found.
Parameters
a: array-like, with `np.bytes_` or `np.str_` dtypesub: array-like, with `np.bytes_` or `np.str_` dtypestart, end: array-like, with any integer dtype, optional
Returns
out: ndarrayOutput array of ints.
Examples
a = np.array(["Computer Science"]) np.strings.rindex(a, "Science", start=0, end=None)✓
array([9])
See also
- rfind
- str.rindex
Aliases
numpy.char.rindex