python numpy 矩阵
from numpy import *;import numpy as np;randomMat1=np.matrix([0.26358242,0.35134772,0.43263799,2.87872261]);mul1 = np.matrix([100,15,100,15]);T1 = np.matrix([[316.22776602,0.,0.,0.],[0.,3.16227766,0.,0.],[0.,0.,316.22776602,0.],[0.,0.,0.,3.16227766]]);print("randomMat1 shape:",shape(randomMat1));print("mul1 shape:",shape(mul1));print("T1 shape:",shape(T1));T2 = randomMat1*T1;print("T2:",T2);print("T2 shape:",shape(T2));
(wind_2021) F:\PythonProject\ckf>(wind_2021) F:\PythonProject\ckf>python mat1.pyrandomMat1 shape: (1, 4)mul1 shape: (1, 4)T1 shape: (4, 4)T2: [[ 83.35207984 1.11105905 136.81214507 9.1033202 ]]T2 shape: (1, 4)(wind_2021) F:\PythonProject\ckf>(wind_2021) F:\PythonProject\ckf>
##########
总结以上是内存溢出为你收集整理的python numpy 矩阵全部内容,希望文章能够帮你解决python numpy 矩阵所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)