numpy之matrix

numpy的matrix是专门用于处理2维数组的数据类型,它在运算中保持2-D特性。支持特殊的运算符如*(矩阵乘法)和**(矩阵指数)。创建matrix可以通过字符串或列表,常用属性如shape获取行数和列数。可以进行基础运算,如求逆矩阵(a.I)、转置(a.T)以及元素级运算,如np.divide(), np.square()和np.sqrt()。" 126088169,7889824,Java Spring实现OSS图片和视频文件上传,"['Java', 'Spring', '开发语言']

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

A matrix is a specialized 2-D array that retains its 2-D nature through operations. It has certain special operators, such as * (matrix multiplication) and ** (matrix power).

创建方法:

a = np.matrix('1,2; 3,4')

a = np.matrix( [ [ 1,2 ] [ 3,4 ] ] )

使用过的

行列数量     a.shape : (n_rows, n_columns)

统计行、列、整个矩阵     np.min(a, axis = )   max mean sum....

转化为标量    np.asscalar()


基础运算 Matrix Operations:

求逆:     a.I

转置:     a.T


元素运算 Element wise operation: 

np.divide(a)

np.square()

np.sqrt()


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值