我正在尝试使用以下代码写出一个输出5,9矩阵的csv文件
result_array=np.empty((5,9))
for i in range(tbl4.shape[0]):
get_angles=tbl4[i,[13,14,15]]
rot_mat=t3d.euler2mat(*radians(get_angles),'rzxz').reshape(1,9)
result_array=np.append(result_array,[rot_mat],axis=0)
但是,
print(result_array)
不返回值。 我不确定自己在做什么错,也不介意在修复此代码方面获得帮助。
谢谢!
tbl4是5x16矩阵
[[ 1.000000e+00 1.000000e+01 0.000000e+00 1.000000e+00 1.000000e+00
1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 0.000000e+00
1.640000e+03 3.110000e+03 1.780000e+03 8.712900e+00 1.422611e+02
-1.023384e+02]
[ 1.000000e+00 1.000000e+01 0.000000e+00 2.000000e+00 1.000000e+00
1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 0.000000e+00
1.750000e+03 2.890000e+03 1.810000e+03 3.789880e+01 7.270230e+01
8.854010e+01]
[ 1.000000e+00 1.000000e+01 0.000000e+00 3.000000e+00 1.000000e+00
1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 0.000000e+00
1.870000e+03 3.180000e+03 1.450000e+03 1.392469e+02 8.402020e+01
-1.192579e+02]
[ 1.000000e+00 1.000000e+01 0.000000e+00 4.000000e+00 1.000000e+00
1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 0.000000e+00
1.990000e+03 2.960000e+03 1.490000e+03 1.299047e+02 1.094238e+02
1.722355e+02]
[ 1.000000e+00 1.000000e+01 0.000000e+00 5.000000e+00 1.000000e+00
1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 0.000000e+00
1.750000e+03 2.970000e+03 1.410000e+03 -1.648163e+02 7.195840e+01
-8.448190e+01]]