Feb-22-2021, 08:54 AM
Not a numpy expert here, but this seems to reverse all the axis simultaneously
import numpy as np random_array = np.round(10 * np.random.rand(5, 4, 4)) sorted_array = np.sort(random_array,axis=1) a = sorted_array.reshape(sorted_array.size) reversed_array = a[::-1].reshape(sorted_array.shape) print('Sorted Array:') print(sorted_array,'\n') print('Reversed Array:') print(reversed_array)