本文简要介绍 python 语言中  numpy.geterrcall  的用法。
用法:
numpy.geterrcall()返回用于浮点错误的当前回调函数。
当浮点错误(“divide”, “over”, “under”或“invalid”之一)的错误处理设置为‘call’或‘log’时;调用的函数或写入的日志实例由
geterrcall返回。该函数或日志实例已使用seterrcall设置。- errobj: 可调用,日志实例或无
 当前的错误处理程序。如果没有通过
seterrcall设置处理程序,则返回None。
返回:
注意:
有关浮点异常类型和处理选项的完整文档,请参阅
seterr。例子:
>>> np.geterrcall() # we did not yet set a handler, returns None>>> oldsettings = np.seterr(all='call') >>> def err_handler(type, flag): ... print("Floating point error (%s), with flag %s" % (type, flag)) >>> oldhandler = np.seterrcall(err_handler) >>> np.array([1, 2, 3]) / 0.0 Floating point error (divide by zero), with flag 1 array([inf, inf, inf])>>> cur_handler = np.geterrcall() >>> cur_handler is err_handler True
相关用法
- Python numpy geterr用法及代码示例
 - Python numpy geterrobj用法及代码示例
 - Python numpy get_include用法及代码示例
 - Python numpy geomspace用法及代码示例
 - Python numpy genfromtxt用法及代码示例
 - Python numpy gradient用法及代码示例
 - Python numpy gcd用法及代码示例
 - Python numpy greater_equal用法及代码示例
 - Python numpy greater用法及代码示例
 - Python numpy RandomState.standard_exponential用法及代码示例
 - Python numpy hamming用法及代码示例
 - Python numpy legendre.legint用法及代码示例
 - Python numpy chararray.ndim用法及代码示例
 - Python numpy chebyshev.chebsub用法及代码示例
 - Python numpy chararray.nbytes用法及代码示例
 - Python numpy ma.indices用法及代码示例
 - Python numpy matrix.A1用法及代码示例
 - Python numpy MaskedArray.var用法及代码示例
 - Python numpy ma.zeros用法及代码示例
 - Python numpy broadcast用法及代码示例
 - Python numpy matrix.T用法及代码示例
 - Python numpy matrix.I用法及代码示例
 - Python numpy MaskedArray.T用法及代码示例
 - Python numpy hermite.hermfromroots用法及代码示例
 - Python numpy hermite_e.hermediv用法及代码示例
 
注:本文由纯净天空筛选整理自numpy.org大神的英文原创作品 numpy.geterrcall。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
