python中矩阵坐标范围_Python | 矩阵范围

本文介绍了在Python中如何使用NumPy库的numpy.ptp()函数来计算矩阵的范围,即矩阵元素的最大值与最小值之差。
摘要由CSDN通过智能技术生成

python中矩阵坐标范围

The range of a matrix can be defined as the difference between the maximum and minimum among the elements of the matrix. In NumPy, we have provided with an inbuilt function for this operation i.e. numpy.ptp(). It returns the range of the matrix by calculating maximum-minimum.

矩阵范围可以定义为矩阵元素之间的最大值和最小值之差。 在NumPy中,我们为此操作提供了一个内置函数,即numpy.ptp() 。 它通过计算最大最小值返回矩阵的范围。

Python | Range of a Matrix Output

Python代码查找矩阵范围 (Python code to find range of a matrix)

# Linear Algebra Learning Sequence
# Range of a Matrix

import numpy as np

a = np.array([[14,5,3], [7,8,9], [4,2,-6]])

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值