Код: Выделить всё
x=[[9.62825826e-04 7.54653307e+00 1.54219786e+01 1.56003006e+01
7.56356875e+00]
[2.13913061e+01 7.99323940e-01 4.54427893e+01 2.40201556e+01
1.69257932e+01]
[4.52324126e+01 4.54569526e+01 9.69601669e-03 4.59271880e+01
2.85163398e+01]
[4.54089845e+01 2.32183545e+01 4.59253670e+01 2.47722494e-03
2.36843962e+01]
[2.14375302e+01 1.69550555e+01 2.85025533e+01 2.44858206e+01
7.98947124e-01]]
i=x.argsort(axis=None) #axis=None to flatten whole array and sort over all values
j=np.reshape(i, (x.shape)) #reshape the sorted indices in a meaningful way
for k in tree1.keys(): #just enumerating over some dictionaries that form part of my code, not necessary to know what they are
for p in tree2.keys(): #basically just counting the length of the array in x and y directions
if j[k][p]==0: #to find lowest value value indices, so i can access the value later
print("heres the index of that value", k,p)
print(j)
Код: Выделить всё
[[ 0 18 12 24 6]
[ 1 4 2 3 9]
[21 5 20 16 19]
[ 8 23 22 14 10]
[15 7 11 17 13]]
Подробнее здесь: https://stackoverflow.com/questions/666 ... y-properly