This is a pre-release version (latest).Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy latest / numpy / strings / rindex

function

numpy.strings:rindex

source: build-install/usr/lib/python3.14/site-packages/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_` dtype
sub : array-like, with `np.bytes_` or `np.str_` dtype
start, end : array-like, with any integer dtype, optional

Returns

out : ndarray

Output 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