numpy find index of matching values

import numpy as np
# init arrays
a = np.array([1,2,3,2,3,4,3,4,5,6])
b = np.array([7,2,10,2,7,4,9,4,9,8])

#using enumerate, list comprehension and set
print([key for key, val in enumerate(a) if val in set(b)])
# output
# [1, 3, 5, 7]

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
numpy find index of match find index of certain values in numpy array how to find value at particular index numpy array numpy return the index of matching element numpy find index of values numpy find index of value in array numpy array find index of value how to find index of row in numpy where value np.where to find index get index of array np numpy array find where element is how to get index of specic value in numpy array python find value in numpy array np get position numpy get index of array items numpy value of list index np.where get index np find indices of elements how to find index of value in numpy array how to find index of specific element of an array in numpy how to find index value of array in python np.find the index np.where index find index where one of the items in an array first appear in numpy find index of an item in np array find element from numpy array getindex numpy numpy get index by value python numpy find index of value index of in numpy array numpy array get index of ma python numpy get index : python numpy get index np locate value finding the index of an element in an array numpy get index of numpy array element np.where return index return index using np.where np return index of a value find position of element in numpy array numpy matrix find all indices containing value numpy get all indices of matrix row containing value position numpy array find element in numpy array python get position of value in numpy array get index of element in numpy array python find index numpy array value get index in numpy array get index np whre find index of all matching element in list python get index of element in np arraty index of np array get indices in numpy arrays based on key name get index from value numpy find values in matrix numpy how to get the index of an element in a numpy array np array find value index ndarray indexof value np array indexof ndarray indexof find index of numner in numpy array find position of numner in numpy array get the index of elements in an array numpy python nupmy get index find the index of an element in a numpy array python find array in array numpy np.where indexing get index of a value on a numpy list numpy where return indices find index of an array which is matching value in num find indexes in numpy array get np array index np array get index nparr get index numpy array index value how to get the index of a particular element in a numpy array how to find index of an element in a numpy array index of item in numpy array python get indices of nmpy elements numpy find a value in an array numpy find index of a value numpy find the index of a value how to get index of elements in numpy array find index of element in numpy array find element in numpy array find in numpy array numpy getting the index of an array numpy index of numpy find index in list get indice array python numpy find index of element in array find index in list python numpy numpy array get all index with value get numpy array index numpy array geti ndex get index of element python nparray how to find the index value in np arrray find index in array python numpy numpy take get index find index position in python np Index index of value in np array numpy return index how to return poistions of of a value in np array find indices of value in array python numpy where get value numpy list find index numpy get indexes where array cond .where numpy get indexes where array cond .find numpy get indexes where array cond find location in numpy array numpy array get position of value numpy get index is in list find index of numpy array python numpy array go to inde numpy.ndarray get index of value numpy indexes return array numpy indices with value numpy get indices numpy print index of value ndarray find index based on value python return index of specific valua matrix python indexes from value numpy matrix how to get the index of an item in a numpy array return index of numpy array by value numpy array index of value how to find index of element in numpy array np index of np index of value how to find the index of an element in a numpy array find index of element numpy find index of item in numpy array numpy index of element numpy find indices of element how to return the index numpy array find index of an element in numpy matrix find indices of value in matrix python get index from numpy array np where index how to return indicies of a number in numpy numpy condition on index of element numpy index where numpy find the index of a value in an array index of a value in a np array index of item in arrray numpy np array find index numpy find idex by condition numpy find idex by con np find indexes of vlue get the index of a value in an np.array python python get index of value in numpy array np.where of next index np.where next index numpy find index of value numpy get index of value index of a value np.array python numpy array index where value ndarray get indexes that match number find index in np array index of np finding an index in python array python find index in numpy array find the index of a value in array python numpy index of value python how to get index of item in numpy array check the index of a value in a np array get index numpy find index of element in np array python check index of number in numpy array print index of a numpy array get index of element in array numpy numpy array get index numpy index array using where value np.index of np index of element how to get index of ndarray python array index of value numpy python get index of item in numpy array how to find element in matrix python numpy numpy get index numpy get index of element with value get np.array idx by content how to get indices of numpy array find index in numpy array get index of np array numpy get cell index from value pyhton fint he index of a value in an array get index of element in np array python find index of value in numpy array numpy find index where value equals extract index from np array how to get index of value numpy numpy get index of element in array np array index of element np find index of element how to get index of value in numpy array find index of value in array python numpy np.array find index find first index of nump array find index of data numpy python numpy array find position of element how to find index of element in 2dnp array how to find index of element in np array get the index of an item in np numpy find location of element how to get the index of a number in numpy array find index of value in array python index of numpy array by value index of numpy array value numpy array find index of values how to get the numpy index of a value find an element in matrix numpy numpy find index of matching values
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source