numpy阶跃函数 numpy.heaviside

numpy.heaviside(x1,x2)
Compute the Heaviside step function.
官方链接
x1 [array_like] Input values.
x2 [array_like] The value of the function when x1 is 0.
在这里插入图片描述
示例:

np.heaviside([-1.5, 0, 2.0], 0.5)
array([ 0. ,  0.5,  1. ])
np.heaviside([-1.5, 0, 2.0], 1)
array([ 0.,  1.,  1.])

版权声明:本文为Jinyindao243052原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。