This is a pre-release version (2.5.0.dev0+git20251130.2de293a). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.5.0.dev0+git20251130.2de293a / 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)

See also

rfind
str.rindex

Aliases

  • numpy.char.rindex