I have an array that represents poker cards held by players. Each player holds 6 cards and the cards have a value of 1-12 and have a corresponding suit of 1-4.
The first player for example would hold the following 7 cards:
deck=np.array([[[ 6., 2.],
[ 10., 1.],
[ 5., 1.],
[ 9., 2.],
[ 4., 1.],
[ 3., 2.],
[ 11., 2.]]])
My problem now is that when I sort the cards to see which one has the highest value (in this case 11 with the corresponding suit 2)
sortedcards=-np.sort(-unsortedCards,axis=1)
It does not only sort the values in the first column, but also the ones in the second (which is the suit).
How can I sort only the first column and keep the second column assigned to the first one so that I don't lose the information which values has which suit?
Please bear in mind that the above example is only with one player but there will be several players. So the array has an additional dimension.
Important: The solution has to by pure NumPy matrix operation only.