Keep them in your NumPy Arsenal — 1. np.nonzero The nonzero function returns the list of indexes on which nonzero elements in the array are located. import numpy as np arr = np.random.randint(-4,4, size=10) print(arr) print(np.nonzero(arr)) >>
[-1 -1 0 1 -4 -3 -1 -1 2 -1] (array([0, 1, 3, 4, 5, 6, 7, 8, 9]),) 2. np.copysign The copysign, as…