If you just want to reverse it:
brr[:] = brr[::-1]
Actually, this reverses along axis 0. You could also revert on any other axis, if the array has more than one.
To sort in reverse order:
>>> arr = np.random.random((1000,1500))
>>> brr = np.reshape(arr, arr.shape[0]*arr.shape[1])
>>> brr.sort()
>>> brr = brr[::-1]
>>> brr
array([ 9.99999960e-01, 9.99998167e-01, 9.99998114e-01, ...,
3.79672182e-07, 3.23871190e-07, 8.34517810e-08])
or, using argsort:
>>> arr = np.random.random((1000,1500))
>>> brr = np.reshape(arr, arr.shape[0]*arr.shape[1])
>>> sort_indices = np.argsort(brr)[::-1]
>>> brr[:] = brr[sort_indices]
>>> brr
array([ 9.99999849e-01, 9.99998950e-01, 9.99998762e-01, ...,
1.16993050e-06, 1.68760770e-07, 6.58422260e-08])
reverse()
to do? – NPE Feb 14 '13 at 12:52arr.size
instead ofarr.shape[0]*arr.shape[1]
. – Junuxx Feb 14 '13 at 12:59