Sort a numpy array DECREASING
user_6939821
python
2 years ago
171 B
3
Indexable
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])
Editor is loading...