Re: [Numpy-discussion] question on use of newaxis

2011-02-09 Thread Friedrich Romstedt
2011/2/9 Mark Bakker : > a = array([1,2,3]) > > I want to take the last two terms and make it a column vector: > > a[[1,2],newaxis] > a[[1,2]][:,newaxis] The former is advanced indexing, while the latter is basic slicing (after advanced indexing). See http://docs.scipy.org/doc/numpy/reference/arr

[Numpy-discussion] question on use of newaxis

2011-02-09 Thread Mark Bakker
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 understa