📜  numpy.nanstd()函数Python

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

numpy.nanstd()函数Python

numpy.nanstd()函数计算沿指定轴的标准偏差,同时忽略 NaN。

代码#1:

# Python program explaining
# numpy.nanstd() function
       
# importing numpy as geek 
import numpy as geek 
   
arr = geek.array([[1, 2], [geek.nan, 4]])
   
gfg = geek.nanstd(arr)
   
print (gfg)

输出 :

1.247219128924647


代码#2:

# Python program explaining
# numpy.nanstd() function
       
# importing numpy as geek 
import numpy as geek 
   
arr = geek.array([[1, 2], [geek.nan, 4]])
   
gfg = geek.nanstd(arr, axis = 0)
   
print (gfg)

输出 :

[0. 1.]