In this example we will show how to search a NumPy array and find the indexes where the values are odd in Python.
Source Code
import numpy as np
n = np.array([1, 2, 3, 3, 2, 3, 1])
result = np.where(n % 2 == 1)
print(result)
Output:
(array([0, 2, 3, 5, 6], dtype=int32),)