[Numpy-discussion] Bug in piecewise?

Geoffrey Zhu zyzhu2000@gmail....
Fri Oct 19 22:52:12 CDT 2007


Hi All,

If I execute the following code, I find that function f() sometimes is
called with an empty array. I am not sure why this is necessary. Is
this a bug?

def f(x):
   return x**2
return numpy.piecewise(u, abs(u)<1, [f, 0])

Thanks,
Geoffrey


More information about the Numpy-discussion mailing list