Hello list,

I am trying to specify the indices of an array with a list and add a
newaxis, but that combination doesn't seem to be allowed. Any reason why?
Here's an example:

a = arange(3)

This works:

a[[0,2]][:,newaxis]
Out[445]:
array([[0],
       [2]])

This is more elegant syntax (and, I thought, correct), but it doesn't work:

a[[0,2],newaxis]
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/Users/mark/ttim/svn/trunk/<ipython-input-444-b37a4cca4311> in <module>()
----> 1 a[[0,2],newaxis]

TypeError: long() argument must be a string or a number, not 'NoneType'
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to