NumPy Matrix 与 Array 类的乘法有何不同? [英] how does multiplication differ for NumPy Matrix vs Array classes?

查看:20
本文介绍了NumPy Matrix 与 Array 类的乘法有何不同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

numpy 文档建议使用数组而不是矩阵来处理矩阵.但是,与八度(我直到最近才使用)不同,* 不执行矩阵乘法,您需要使用函数 matrixmultipy().我觉得这使得代码非常不可读.

The numpy docs recommend using array instead of matrix for working with matrices. However, unlike octave (which I was using till recently), * doesn't perform matrix multiplication, you need to use the function matrixmultipy(). I feel this makes the code very unreadable.

有人分享我的观点并找到解决方案吗?

Does anybody share my views, and has found a solution?

推荐答案

在 3.5 中,Python 终于 得到了一个矩阵乘法运算符.语法是a @ b.

In 3.5, Python finally got a matrix multiplication operator. The syntax is a @ b.

这篇关于NumPy Matrix 与 Array 类的乘法有何不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆