Python Numpy matrix.min()

Python Numpy matrix.min()

Numpy matrix.min()方法的帮助下,我们可以从给定的矩阵中获得最小值。

语法: matrix.min()

返回:从给定的矩阵中返回最小值

例子#1 :
在这个例子中,我们可以看到,在matrix.min()方法的帮助下,我们能够从一个给定的矩阵中获得最小值。

# import the important module in python
import numpy as np
          
# make matrix with numpy
gfg = np.matrix('[64, 1; 12, 3]')
          
# applying matrix.min() method
geeks = gfg.min()
    
print(geeks)

输出:

1

例子#2 :

# import the important module in python
import numpy as np
          
# make a matrix with numpy
gfg = np.matrix('[1, 2, 3; 4, 5, 6; 7, 8, -9]')
          
# applying matrix.min() method
geeks = gfg.min()
    
print(geeks)

输出:

-9

Python教程

Java教程

Web教程

数据库教程

图形图像教程

大数据教程

开发工具教程

计算机教程