只要结果不要过程!
博主懒地写输入。。。
不懂啥是mean rank,就没救了~
import numpy as np
A = [[26.44, 25.8, 25.54, 25.75, 25.32, 26.04, 25.23, 25.11, 24.45],
[1.9, 1.88, 4.1, 1.93, 2.88, 2.97, 3.3, 2.96, 1.8],
[27.26, 28.39, 28.06, 27.45, 27.67, 30.81, 29.23, 26.62, 26.42],
[17.78, 15.14, 25.63, 13.98, 16.67, 20.91, 25, 17.39, 11.2],
[10.17, 10.06, 9.86, 9.79, 10.05, 10.48, 11.24, 10.11, 9.26],
[23.15, 22.41, 23.07, 23.01, 22.22, 22.48, 25.85, 21.77, 19.52],
[25.98, 26.34, 27.05, 26.02, 26.24, 28.76, 26.83, 26.19, 25.59],
[66.51, 66.82, 67.44, 64.35, 64.6, 63.2, 63.1, 63.81, 63.01]]
# print(A)
A = np.array(A)
# print(A)
R = np.argsort(A,axis=1)
print(R)
b = [1,2,3,4,5,6,7,8,9]
D = np.zeros((8,9))
for i in range(8):
for j in range(9):
h = R[i,j]
D[i,h] = b[j]
print(D)
print(np.mean(D,axis=0))