[Numpy-discussion] question on use of newaxis
Mark Bakker
markbak@gmail....
Wed Feb 9 04:00:31 CST 2011
Hello List,
I have a simple array
a = array([1,2,3])
I want to take the last two terms and make it a column vector:
a[[1,2],newaxis]
But I get a funny error: TypeError: long() argument must be a string or a
number, not 'NoneType'
It does work if I do
a[[1,2]][:,newaxis]
But I don't understand why the first wouldn't work. Is there a reason such
syntax is not supported? It would be very useful.
Thanks,
Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20110209/8bd592a0/attachment.html
More information about the NumPy-Discussion
mailing list