import numpy as np
print("Original array:\n")
nums = np.random.randint(0,10,(3,3))
print(nums)
print("\nSort the said array by the nth column: ")
print(nums[nums[:,1].argsort()])
Sample Output:
Original array:
[[1 5 0]
[3 2 5]
[8 7 6]]
Sort the said array by the nth column:
[[3 2 5]
[1 5 0]
[8 7 6]]
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer