m = [[0] * np.array(e).shape[1] for i in range(np.array(e).shape[0])]
j = 0
if np.array(e).shape[0] % 2 == 0:
for i in range(0, int(len(e) / 2) , 2):
print('-', i)
m[j] = mean_(e[i], e[i + 1])
j += 1
m = np.array(m)
m = m[[not np.all(m[i] == 0) for i in range(m.shape[0])], :]
if np.array(m).shape[0] == 1:
return m
else:
for i in range(0, int(len(e) / 2)+1, 2):
print('--', i)
m[j] = mean_(e[i], e[i + 1])
j += 1
m = np.array(m)
m = m[[not np.all(m[i] == 0) for i in range(m.shape[0])], :]
m1 = mean_eigenvectors(m)
m1 = np.array(m1)
m1 = m1[[not np.all(m1[i] == 0) for i in range(m1.shape[0])], :]
if m1.shape[0] == 1:
m0 = mean_(m1, e[-1])
return m0
标签:16,32,....,range,shape,m1,np,array,mean
From: https://blog.51cto.com/u_16484455/9030113