選擇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:每行