numpy.min(axis)用法

本文详细介绍了如何使用Numpy库中的min函数来获取矩阵中最小值的方法,并针对不同的参数设置进行了具体说明,如axis参数的使用场景及其含义。

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

选择python,就是选择使用数学工具解决问题。
numpy中的矩阵运算功能可谓强大,但手册不多。规律要自己总结。

numpy.ma.min
numpy.ma.min(obj, axis=None, out=None, fill_value=None, keepdims=)[source]

Return the minimum along a given axis.

Parameters:

axis : {None, int}, optional

Axis along which to operate. By default, axis is None and the flattened input is used.

out : array_like, optional

Alternative output array in which to place the result. Must be of the same shape and buffer length as the expected output.

fill_value : {var}, optional

Value used to fill in the masked values. If None, use the output of minimum_fill_value.

Returns:

amin : array_like

New array holding the result. If out was specified, out is returned.

See also

minimum_fill_value
Returns the minimum filling value for a given datatype.

重点看看 axis,这里没有告诉你none、0、1表示啥。需要查找:

  • none:整个矩阵
  • 0:每列
  • 1:每行
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值