首先,创建一个numpy数组:
import numpy as np
arr = np.asarray(a)
arr
array([[ 1. , 0.3491, 0. , 0. , 0. , 0. , 0. ,
0. , 0. , 0. , 1. , 0.1648, 0. , 0. ,
0. , 0. , 0. , 0. , 0. , 0. , 1. ,
0. , 0. , 0. , 0. , 0. , 0. , 0. ,
0. , 0. , 1. , 0. , 0. , 0. , 0. ,
0. , 0. , 0. , 0. , 0. , 1. , 0. ,
0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. ],
[ 0.4269, 0. , 0. , 0. , 0. , 0. , 0. ,
0. , 0. , 0. , 0.225 , 0.1637, 0. , 0. ,
0. , 0. , 0. , 0. , 0. , 0. , 0.4269,
0. , 0. , 0. , 0. , 0. , 0. , 0. ,
0. , 0. , 0.2929, 0. , 0. , 0. , 0. ,
0. , 0. , 0. , 0. , 0. , 0.4078, 0. ,
0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. ],
[ 0.4212, 0. , 0. , 0. , 0. , 0. , 0. ,
0. , 0. , 0. , 0.1719, 0. , 0. , 0. ,
0. , 0. , 0. , 0. , 0. , 0. , 0.3856,
0. , 0. , 0. , 0. , 0. , 0. , 0. ,
0.