[SciPy-user] "dynamic" indexing

Addison, Jason JADDISON at SYSTEMS.TEXTRON.com
Wed Jun 9 20:27:32 CDT 2004


How can I take a slice from an array when I do not know before hand the 
dimension of the source array? For example:

# slice is genereated dynamically, its length is not known before hand
slice = [(2,4),(1,4),(0,15)]
# then I'd like to somehow use slice to slice an array
a[slice] -> a[2:4,1:4,0:15]

Thank you



More information about the SciPy-user mailing list