Parameter Name:numpy.msort()
Description : Return a copy of an array sorted along the first axis.
Parameter Name: numpy.sort_complex()
Description : Sort a complex array using the real part first, then the imaginary part.
Parameter Name: numpy.partition()
Description : Return a partitioned copy of an array.
Parameter Name: numpy.argpartition()
Description : Perform an indirect partition along the given axis using the algorithm specified by the kind keyword.
The first step would be to give syntax
command:
numpy.sort_complex(arr)
import numpy as geek
in_arr = [2 + 4j, 5 + 9j, 3 - 2j, 4 - 3j, 3 + 5j, 2-4j, 5]
print ("Input array : ", in_arr)
out_arr = geek.sort_complex(in_arr)
print ("Output sorted array : ", out_arr)
Output :
Example :
Code :
import numpy as np
a = np.array([[12,18], [20,5]])
arr1 = np.sort(a, axis = 0)
print ("Along first axis : ", arr1)
a = np.array([[10, 15], [12, 1]])
arr2 = np.sort(a, axis = -1)
print ("Along first axis : ", arr2)
a = np.array([[12, 15], [10, 1]])
arr1 = np.sort(a, axis = None)
print ("Along none axis : ", arr1)
Output :
Comments