September 12th, 2013, 08:49 AM
This puzzled me too, first time I saw this ambiguity message.
Do you want
array((0,1)) and array((1,1))
to evaluate to
array((0,1)) or to True?
You probably want:
A = numpy.array((0,1,2,3))
print((1<A) * (A%2))
The complete table of dyadic Boolean operations written as common operators <, *, GCD, etceteras is shown here.
It also appears in, as I recall, the gtk operations for combining bit maps.
non_zero_idx = ((target_std > 0) *(warped_std > 0) *(mask.data))
[/code] are essential for python code!
Last edited by b49P23TIvg : September 12th, 2013 at 08:53 AM.
Reason: remove unneeded assignment.