From: <val...@bl...> - 2006-11-14 01:32:31
|
Using numpy 1.0, why does >>> a = numpy.array([0.0,1.0,2.0],'d') >>> numpy.where(a == 0.0,1,1/a) give the correct result, but with the warning "Warning: divide by zero encountered in divide"? ? I thought that the point of where was that the second expression is never used for the elements where the condition evaluates true. If this is the desired behavior, is there a way to suppress the warning? Thanks! Michele |