码迷,mamicode.com
首页 > 编程语言 > 详细

python.numpy.std()计算矩阵标准差

时间:2017-12-28 16:09:03      阅读:277      评论:0      收藏:0      [点我收藏+]

标签:color   std   col   gpo   矩阵   axis   blog   bsp   class   

1 >>> a = np.array([[1, 2], [3, 4]])  
2 >>> np.std(a) # 计算全局标准差  
3 1.1180339887498949  
4 >>> np.std(a, axis=0) # axis=0计算每一列的标准差  
5 array([ 1.,  1.])  
6 >>> np.std(a, axis=1) # 计算每一行的标准差  
7 array([ 0.5,  0.5]) 

 

python.numpy.std()计算矩阵标准差

标签:color   std   col   gpo   矩阵   axis   blog   bsp   class   

原文地址:https://www.cnblogs.com/lfydeblog/p/8135810.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!