🌐
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 › 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])
🌐
GeeksforGeeks
geeksforgeeks.org › python › numpy-find-in-python
numpy.find() in Python - GeeksforGeeks
November 28, 2018 - numpy.core.defchararray.find(arr, substring, start=0, end=None): Finds the lowest index of the sub-string in the specified range. Parameters: arr : array-like or string to be searched. substring : substring to search for. start, end : [int, ...
🌐
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.’
Address: Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
🌐
Statology
statology.org › home › how to find index of value in numpy array (with examples)
How to Find Index of Value in NumPy Array (With Examples)
September 17, 2021 - This tutorial explains how to find the index location of specific values in a NumPy array, including examples.
🌐
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
Find elsewhere
🌐
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])
🌐
w3resource
w3resource.com › numpy › string-operations › find.php
Numpy: numpy.char.find() function - w3resource
April 28, 2026 - The numpy.char.find() function returns the lowest index of the substring in the given string.
🌐
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.
🌐
ProjectPro
projectpro.io › recipes › find-closest-value-given-scalar-vector
How to use NumPy to find the closest value in an array in Python- ProjectPro
October 20, 2023 - In this example, we generate an array of 100 values ranging from 0 to 99 using NumPy's arange function. ... We also need a reference value to which we want to find the closest value within the 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 ·
🌐
Vultr Docs
docs.vultr.com › python › third party › numpy › where()
Python Numpy where() - Conditional Element Search
December 30, 2024 - The numpy.where() function is a versatile tool in the Python numpy library, primarily used to locate elements or indices in an array that meet certain conditions.