Use argsort
as follows:
arr1inds = arr1.argsort()
sorted_arr1 = arr1[arr1inds[::-1]]
sorted_arr2 = arr2[arr1inds[::-1]]
This example sorts in descending order.
More Related Contents:
- Sorting arrays in NumPy by column
- Rank items in an array using Python/NumPy, without sorting array twice
- A fast way to find the largest N elements in an numpy array
- Sorting a 2D numpy array by multiple axes
- How can I “zip sort” parallel numpy arrays?
- Find elements of array one nearest to elements of array two
- Sort invariant for numpy.argsort with multiple dimensions
- Efficiently sorting a numpy array in descending order?
- sort eigenvalues and associated eigenvectors after using numpy.linalg.eig in python
- Sorting a python array/recarray by column
- argsort for a multidimensional ndarray
- How to print the full NumPy array, without truncation?
- Sort list of lists ascending and then descending
- Numpy array assignment with copy
- Repeating each element of a numpy array 5 times
- Calculate weighted average using a pandas/dataframe
- Comparing previous row values in Pandas DataFrame
- Ambiguity in Pandas Dataframe / Numpy Array “axis” definition
- How to create a numpy array of arbitrary length strings?
- Subsetting a 2D numpy array
- How to normalize a 2-dimensional numpy array in python less verbose?
- Counting unique values in a column in pandas dataframe like in Qlik?
- How to get a normal distribution within a range in numpy? [duplicate]
- Annotate Time Series plot in Matplotlib
- How can I count the number of consecutive TRUEs in a DataFrame?
- Sort a list with a custom order in Python
- Inverting a numpy boolean array using ~
- How to do a polynomial fit with fixed points
- How to have logarithmic bins in a Python histogram
- Numpy.Array in Python list?