In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail the example analysis of multiplication dot and corresponding component multiplication multiply in python. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
Vector point multiplication (dot) and corresponding component multiplication (multiply):
> aarray ([1,2,3]) > barray ([1.1,1.1,1.]) > np.multiply (arect b) array ([1.2,3.]) > np.dot (apeny b) 6.0
Matrix multiplication (dot) and corresponding component multiplication (multiply):
> cmatrix ([[1,2,3]]) > dmatrix ([1.,1.1,1]]) > np.multiply (CPHEROD) matrix ([1.1,2.3,3]]) > np.dot (CPRIND) Traceback (most recent call last): File ", line 1, in ValueError: shapes (1MULIN3) and (1MUR 3) not aligned: 3 (dim 1)! = 1 (dim 0)
When writing code, * indicates that the corresponding components are multiplied (multiply):
> a*barray ([1,2., 3.]) > c*dTraceback (most recent call last): File ", line 1, in File" C:\ ProgramData\ Anaconda3\ lib\ site-packages\ numpy\ matrixlib\ defmatrix.py ", line 343, in _ mul__ return N.dot (self) Asmatrix (other) ValueError: shapes (1Magne3) and (1Magne3) not aligned: 3 (dim 1)! = 1 (dim 0) on "sample analysis of multiplicative dot and multiplicative multiply of corresponding components in python", this article ends here. Hope that the above content can be helpful to you, so that you can learn more knowledge, if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un