[Numpy-discussion] Can't mix np.newaxis with boolean indexing
Fri Aug 19 10:50:50 CDT 2011
I could have sworn that this use to work:
import numpy as np
a = np.random.random((100,))
b = (a > 0.5)
print a[b, np.newaxis]
But instead, I get this error on the latest master:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: long() argument must be a string or a number, not 'NoneType'
Note, the simple work-around would be "a[b][:, np.newaxis]", but I can't
imagine why the intuitive syntax would not be valid.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion