Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

np.sort descending

array = np.array([7, 5, 3, 2, 6, 1, 4])

# Sort in ascending order
sorted_array = np.sort(array)
# [1, 2, 3, 4, 5, 6, 7]

# Reverse the sorted array
reverse_array = sorted_array[::-1]
# [7, 6, 5, 4, 3, 2, 1]
Comment

PREVIOUS NEXT
Code Example
Python :: generate random prime number python 
Python :: matplotlib draw a line between two points 
Python :: repeat 10 times python 
Python :: gdscript 2d movement 
Python :: ubuntu download file command line 
Python :: backup django db from one database to another 
Python :: get text from image python 
Python :: pearson corr 
Python :: pandas create dataframe of ones 
Python :: how to give multiple option to the user and ask the same question again and again until the user tells one of the options 
Python :: pair plot python 
Python :: Date difference in minutes in Python 
Python :: split imagedatagenerator into x_train and y_train 
Python :: pandas replace empty strings with NaN 
Python :: select only object columns pandas 
Python :: python memoization 
Python :: python check if character before character in alphabet 
Python :: python datetime from isoformat 
Python :: check if a value in dataframe is nan 
Python :: get home directory in windows python os 
Python :: exit python script 
Python :: how to equal two arrays in python with out linking them 
Python :: python request example 
Python :: min max scaling pandas 
Python :: how to make a pygame window 
Python :: exact distance math 
Python :: euclidean distance python 
Python :: average out all rows pandas 
Python :: spike python 
Python :: python head function show all columns 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =