I am trying to Sort the array by the second row. For n1, I use two square brackets [][] whereas for n2 I use a single square bracket [,]. I am trying to understand why do I get different results?
Thank you in advance.
import numpy
sampleArray = numpy.array([[34, 43, 73], [82, 22, 12], [53, 94, 66]])
print(sampleArray)
n1= sampleArray[:][sampleArray[1,:].argsort()]
n2 = sampleArray[:,sampleArray[1,:].argsort()]
print(n1)
print(n2)