numpy.char.rindex
- char.rindex(a, sub, start=0, end=None)[source]
-
Like
rfind, but raisesValueErrorwhen the substringsubis not found.- Parameters:
-
-
aarray_like, with
StringDType,bytes_orstr_dtype -
subarray_like, with
StringDType,bytes_orstr_dtype - start, endarray-like, with any integer dtype, optional
-
aarray_like, with
- Returns:
-
- outndarray
-
Output array of ints.
See also
Examples
>>> a = np.array(["Computer Science"]) >>> np.strings.rindex(a, "Science", start=0, end=None) array([9])
© 2005–2024 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/2.0/reference/generated/numpy.char.rindex.html