python numpy array boolean indexing

Solutions on MaxInterview for python numpy array boolean indexing by the best coders in the world

showing results for - "python numpy array boolean indexing"
Oscar
25 Aug 2016
1x = np.array([1., -1., -2., 3])
2x[x < 0] = 20
3x
4
5Output:
6array([  1.,  20.,  20.,   3.])