bundles / numpy 2.4.3 / numpy / strings / rfind
function
numpy.strings:rfind
source: /numpy/_core/strings.py :293
Signature
def rfind ( a , sub , start = 0 , end = None ) Summary
For each element, return the highest index in the string where substring sub is found, such that sub is contained in the range [start, end).
Parameters
a: array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtypesub: array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtypeThe substring to search for.
start, end: array_like, with any integer dtypeThe range to look in, interpreted as in slice notation.
Returns
y: ndarrayOutput array of ints
Examples
import numpy as np a = np.array(["Computer Science"]) np.strings.rfind(a, "Science", start=0, end=None) np.strings.rfind(a, "Science", start=0, end=8) b = np.array(["Computer Science", "Science"]) np.strings.rfind(b, "Science", start=0, end=None)✓
See also
- str.rfind
Aliases
-
numpy.char.rfind