Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- #numpy array of list values
- values = np.array([1,4,7,1,9,1,10,1])
- #number to search
- searchNum = 1
- #returns a list of where 1 is found in the list to foundIndexes
- foundIndexes = np.where(values == searchNum)[0]
- #print the results
- print(foundIndexes)
Add Comment
Please, Sign In to add comment