python numpy 矩阵

python numpy 矩阵,第1张

概述pythonnumpy矩阵 fromnumpyimport*;importnumpyasnp;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.

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 矩阵所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1185028.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-03
下一篇 2022-06-03

发表评论

登录后才能评论

评论列表(0条)

保存