Sort a numpy array DECREASING
python
2 months ago
171 B
0
Indexable
Never
x1 = np.array([3, 1, 2]) ind_decr = np.argsort(-x1) ### Оно !!!! ind_decr x1_decr = x1[ind_decr] x1_decr ### x1 sorted decreasing ## Out[38]: array([3, 2, 1])
x1 = np.array([3, 1, 2]) ind_decr = np.argsort(-x1) ### Оно !!!! ind_decr x1_decr = x1[ind_decr] x1_decr ### x1 sorted decreasing ## Out[38]: array([3, 2, 1])