Imagine a two dimensional array:
a = np.array([[1,1],[1, 0],[0, 0],[0, 0],[0, 0],[1, 1],[1, 1],[0, 1]])
I want to sort the array based on its first value like:
[[1,1],[1, 1],[1, 1],[1, 0],[0, 1],[0, 0],[0, 0],[0, 0]]
If I am simply going with a .sort() like:
a[::-1].sort(axis=0)
and the returned array looks like:
array([[1, 1],
[1, 1],
[1, **1**],
[**1**, 1],
[0, 0],
[0, 0],
[0, 0],
[0, 0]])
As you can see the bold 1 used to be a zero. Why is the function flipping around my numbers? I searched the internet and haven't found any answers.