本文整理汇总了Python中numpy.core.isnan方法的典型用法代码示例。如果您正苦于以下问题:Python core.isnan方法的具体用法?Python core.isnan怎么用?Python core.isnan使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类numpy.core
的用法示例。
在下文中一共展示了core.isnan方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: gisnan
# 需要导入模块: from numpy import core [as 别名]
# 或者: from numpy.core import isnan [as 别名]
def gisnan(x):
"""like isnan, but always raise an error if type not supported instead of
returning a TypeError object.
Notes
-----
isnan and other ufunc sometimes return a NotImplementedType object instead
of raising any exception. This function is a wrapper to make sure an
exception is always raised.
This should be removed once this problem is solved at the Ufunc level."""
from numpy.core import isnan
st = isnan(x)
if isinstance(st, type(NotImplemented)):
raise TypeError("isnan not supported for this type")
return st