slicing arrays in numpy/scipy
Posted
by user248237
on Stack Overflow
See other posts from Stack Overflow
or by user248237
Published on 2010-04-27T22:59:53Z
Indexed on
2010/04/27
23:03 UTC
Read the original article
Hit count: 210
I have an array like:
a = array([[1,2,3],[3,4,5],[4,5,6]])
what's the most efficient way to slice out a 1x2 array out of this that has only the first two columns of "a"?
I.e.,
array([[2,3],[4,5],[5,6]]) in this case.
thanks.
© Stack Overflow or respective owner