indexing arrays

Emily Rodgers emily at nospam.com
Fri Oct 10 16:04:24 CEST 2008


"John [H2O]" <washakie at gmail.com> wrote in message 
news:mailman.2321.1223644314.3487.python-list at python.org...
>
> I'm having trouble slicing arrays:
>
> I thought I could do the following:
>>>> i = array(range(140,149))
>>>> j = array(range(5,20))
>>>> a = acc[i,j]
> Traceback (most recent call last):
>  File "<string>", line 1, in <string>
> ValueError: shape mismatch: objects cannot be broadcast to a single shape
>
> It's strange, because I can do this:
>
>>>> a = acc[140:148,5:19]
>>>>
>
>
> Anyone know what I am doing wrong?

What data structure is acc, and what are you trying to do? 





More information about the Python-list mailing list