Like find, but raises ValueError when the substring is not found.
StringDType, bytes_, or str_ dtype
StringDType, bytes_, or str_ dtype
Output array of ints.
>>> import numpy as np >>> a = np.array(["Computer Science"]) >>> np.strings.index(a, "Science", start=0, end=None) array([9])
© 2005–2024 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/2.4/reference/generated/numpy.strings.index.html