1. 程式人生 > >python.numpy.std()計算矩陣標準差

python.numpy.std()計算矩陣標準差

numpy array pos spa axis gpo std arr log

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()計算矩陣標準差