For each element, return the lowest index in the string where substring sub is found, such that sub is contained in the range [start, end).
StringDType, bytes_ or str_ dtype
np.bytes_ or np.str_ dtype
The substring to search for.
The range to look in, interpreted as in slice notation.
Output array of ints
See also
>>> import numpy as np >>> a = np.array(["NumPy is a Python library"]) >>> np.strings.find(a, "Python") array([11])
© 2005–2024 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/2.4/reference/generated/numpy.char.find.html