numpy.char.rindex#
- char.rindex(a, sub, start=0, end=None)[source]#
Like
rfind
, but raisesValueError
when the substring sub is 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])