W3Schools
w3schools.com › python › numpy › numpy_array_search.asp
NumPy Searching Arrays
You can search an array for a certain value, and return the indexes that get a match. To search an array, use the where() method. ... import numpy as np arr = np.array([1, 2, 3, 4, 5, 4, 4]) x = np.where(arr == 4) print(x) Try it Yourself »
NumPy
numpy.org › doc › stable › reference › generated › numpy.argwhere.html
numpy.argwhere — NumPy v2.5 Manual
Find the indices of array elements that are non-zero, grouped by element.
06:54
NumPy Searching Arrays - YouTube
07:38
NumPy Searching Arrays in Python | NumPy.where | NumPy.searchsorted ...
07:17
Searching Numpy Arrays The Easy Way - Numpy For Machine Learning ...
03:22
NumPy searchsorted() Tutorial: Find Insertion Indices in Sorted ...
Find index of Numpy array values #numpy #shorts
00:49
Find the Index of the Biggest and Smallest Element of a #numpy ...
NumPy
numpy.org › doc › 2.1 › reference › generated › numpy.strings.find.html
numpy.strings.find — NumPy v2.1 Manual
>>> import numpy as np >>> a = np.array(["NumPy is a Python library"]) >>> np.strings.find(a, "Python") array([11])
NumPy
numpy.org › devdocs › reference › generated › numpy.char.find.html
numpy.char.find — NumPy v2.6.dev0 Manual
>>> import numpy as np >>> a = np.array(["NumPy is a Python library"]) >>> np.strings.find(a, "Python") array([11])
GeeksforGeeks
geeksforgeeks.org › python › how-to-find-the-index-of-value-in-numpy-array
How to find the Index of value in Numpy Array ? - GeeksforGeeks
July 23, 2025 - Here, we find all the indexes of 3 and the index of the first occurrence of 3, we get an array as output and it shows all the indexes where 3 is present. ... # import numpy package import numpy as np # create an numpy array a = np.array([1, 2, 3, 4, 8, 6, 7, 3, 9, 10]) # display index value of 3 print("All index value of 3 is: ", np.where(a == 3)[0]) print("First index value of 3 is: ",np.where(a==3)[0][0])
EDUCBA
educba.com › home › software development › software development tutorials › numpy tutorial › numpy find
NumPy find | How to Find works in NumPy with Examples?
April 3, 2023 - In this program, first, import the numpy library and set the alias name as np. After that, declare an array with four elements such as [‘Happy’ , ‘swap’, ‘Map’, ‘ Laptop’]. Then, print the original array. Once this is done, print the lowest index of substrings by using different start values. As no substring is found, -1 is also returned. Python Program that demonstrates the find function by finding the substring ‘world.’
Call: +917738666252
Address: Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
NumPy
numpy.org › doc › 2.0 › reference › generated › numpy.strings.find.html
numpy.strings.find — NumPy v2.0 Manual
str.find · Examples · >>> a = np.array(["NumPy is a Python library"]) >>> np.strings.find(a, "Python") array([11]) On this page
NumPy
numpy.org › doc › stable › reference › generated › numpy.char.find.html
numpy.char.find — NumPy v2.4 Manual
>>> import numpy as np >>> a = np.array(["NumPy is a Python library"]) >>> np.strings.find(a, "Python") array([11])
NumPy
numpy.org › doc › 1.25 › reference › generated › numpy.char.find.html
numpy.char.find — NumPy v1.25 Manual
Calls str.find element-wise. 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]. ... Optional arguments start and end are interpreted as in slice notation. ... Output array of ints. Returns -1 if sub is not found. ... >>> a = np.array(["NumPy is a Python library"]) >>> np.char.find(a, "Python", start=0, end=None) array([11])
NumPy
numpy.org › doc › stable › reference › generated › numpy.where.html
numpy.where — NumPy v2.5 Manual
>>> import numpy as np >>> a = np.arange(10) >>> a array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) >>> np.where(a < 5, a, 10*a) array([ 0, 1, 2, 3, 4, 50, 60, 70, 80, 90])
Top answer 1 of 12
210
You can use np.where to get indices and np.logical_and to set two conditions:
import numpy as np
a = np.array([1, 3, 5, 6, 9, 10, 14, 15, 56])
np.where(np.logical_and(a>=6, a<=10))
# returns (array([3, 4, 5]),)
2 of 12
84
As in @deinonychusaur's reply, but even more compact:
In [7]: np.where((a >= 6) & (a <=10))
Out[7]: (array([3, 4, 5]),)
NumPy
numpy.org › devdocs › reference › generated › numpy.strings.find.html
numpy.strings.find — NumPy v2.6.dev0 Manual
>>> import numpy as np >>> a = np.array(["NumPy is a Python library"]) >>> np.strings.find(a, "Python") array([11])
GeeksforGeeks
geeksforgeeks.org › python › numpy-string-operations-find-function
find() function - NumPy String Operations - GeeksforGeeks
September 29, 2025 - The numpy.char.find() function is used to locate first occurrence of a substring within each string element of a NumPy array.
w3resource
w3resource.com › python-exercises › numpy › python-numpy-exercise-115.php
Python NumPy: Find indices of elements equal to zero in a NumPy array - w3resource
# Importing the NumPy library and aliasing it as 'np' import numpy as np # Creating a NumPy array 'nums' containing integers nums = np.array([1, 0, 2, 0, 3, 0, 4, 5, 6, 7, 8]) # Printing a message indicating the original array will be displayed print("Original array:") # Printing the original array 'nums' print(nums) # Finding the indices of elements equal to zero in the array 'nums' # Using np.where() to find the indices where the elements are equal to 0 and accessing the first (and only) array of indices result = np.where(nums == 0)[0] # Printing the indices of elements equal to zero in the array 'nums' print("Indices of elements equal to zero of the said array:") print(result)
NumPy
numpy.org › doc › stable › reference › generated › numpy.char.chararray.find.html
numpy.char.chararray.find — NumPy v2.3 Manual
char.chararray.find(sub, start=0, end=None)[source]# For each element, return the lowest index in the string where substring sub is found. See also · char.find ·