📜  Python| numpy matrix.std()

📅  最后修改于: 2022-05-13 01:55:25.982000             🧑  作者: Mango

Python| numpy matrix.std()

借助matrix.std()方法,我们可以使用相同的方法找到矩阵的标准差。

示例 #1:
在此示例中,我们可以使用matrix.std()方法找到矩阵的标准差。

# import the important module in python
import numpy as np
             
# make matrix with numpy
gfg = np.matrix('[4, 1; 12, 3]')
             
# applying matrix.std() method
geek = gfg.std()
   
print(geek)
输出:
4.18330013267

示例 #2:

# import the important module in python
import numpy as np
             
# make matrix with numpy
gfg = np.matrix('[4, 1, 9; 12, 3, 1; 4, 5, 6]')
             
# applying matrix.std() method
geek = gfg.std()
   
print(geek)
输出:
3.3993463424