py> import numarray as na
py> a = na.array([[1,2,3],[4,5,6]])

Yun Mao wrote:
Thanks for the help. numarray doesn't provide what I look for either. e.g. a = array( [[1,2,3],[4,5,6]] )
I sometimes what this: a[ [1,0], :],

py> a[[1,0]] array([[4, 5, 6], [1, 2, 3]])

or even a[ [1,0], [0,1] ] , which should give me
[[4, 5], [1,2]]

py> a[:,:2][[1,0]][[0,1]] array([[4, 5], [1, 2]])

Not the same syntax, of course, but doable.

Steve
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to