[Numpy-discussion] Naming a slice index?

Michael Hoffman b3i4old02@sneakemail....
Tue Oct 2 07:27:05 CDT 2007


Eagle Jones wrote:
> New to python and numpy; hopefully I'm missing something obvious. I'd
> like to be able to slice an array with a name. For example:
> 
> _T = 6:10
> _R = 10:15

from numpy import index_exp

_T = index_exp[6:10]
_R = index_exp[10:15]

> A = identity(20)
> foo = A[_T, _R]



More information about the Numpy-discussion mailing list