MCPcopy Create free account
hub / github.com/numpy/numpy / rindex

Function rindex

numpy/core/defchararray.py:1316–1342  ·  view source on GitHub ↗

Like `rfind`, but raises `ValueError` when the substring `sub` is not found. Calls `str.rindex` element-wise. Parameters ---------- a : array-like of str or unicode sub : str or unicode start, end : int, optional Returns ------- out : ndarray

(a, sub, start=0, end=None)

Source from the content-addressed store, hash-verified

1314
1315@array_function_dispatch(_count_dispatcher)
1316def rindex(a, sub, start=0, end=None):
1317 """
1318 Like `rfind`, but raises `ValueError` when the substring `sub` is
1319 not found.
1320
1321 Calls `str.rindex` element-wise.
1322
1323 Parameters
1324 ----------
1325 a : array-like of str or unicode
1326
1327 sub : str or unicode
1328
1329 start, end : int, optional
1330
1331 Returns
1332 -------
1333 out : ndarray
1334 Output array of ints.
1335
1336 See Also
1337 --------
1338 rfind, str.rindex
1339
1340 """
1341 return _vec_string(
1342 a, int_, 'rindex', [sub, start] + _clean_args(end))
1343
1344
1345@array_function_dispatch(_just_dispatcher)

Callers 1

rindexMethod · 0.85

Calls 2

_vec_stringFunction · 0.90
_clean_argsFunction · 0.85

Tested by

no test coverage detected