I am experimenting with the numpy.where(condition[, x, y]) function. From the numpy documentation, I learn that if you give just one array as input, it shou
numpy.where(condition[, x, y])
Just use np.asarray function. In your case:
>>> import numpy as np >>> array = np.array([1,2,3,4,5,6,7,8,9]) >>> pippo = np.asarray(np.where(array>4)) >>> pippo + 1 array([[5, 6, 7, 8, 9]])