M
Matt Feinstein
If I try
I get:
array([0, 0, 1], type=Bool)
which is pretty slick, However if I set
I get a runtime error: "An array doesn't make sense as a truth value."
So.. why not? It seems to me that if I could vectorize logical
expressions (a la Matlab), it would be a lot easier to write functions
that will take either scalar or vector input values. Am I missing
something?
Matt Feinstein
2 < array([1,2,3])
I get:
array([0, 0, 1], type=Bool)
which is pretty slick, However if I set
q = 2 < array([1,2,3])
q and q
I get a runtime error: "An array doesn't make sense as a truth value."
So.. why not? It seems to me that if I could vectorize logical
expressions (a la Matlab), it would be a lot easier to write functions
that will take either scalar or vector input values. Am I missing
something?
Matt Feinstein