sort np array ascending code example
Example 1: sort numpy array
import numpy as np
arr = np.array([3, 2, 0, 1])
print(np.sort(arr))
Example 2: sort numpy array
import numpy as np
arr = np.array(['banana', 'cherry', 'apple'])
print(np.sort(arr))