Lists and arrays

BartC bc at freeuk.com
Mon Apr 22 17:24:48 EDT 2013



"Ana Dionísio" <anadionisio257 at gmail.com> wrote in message 
news:de1cc79e-cbf7-4b0b-ae8e-18841a1ef095 at googlegroups.com...
> Hello!
>
> I need your help!
>
> I have an array and I need pick some data from that array and put it in a 
> list, for example:
>
> array= [a,b,c,1,2,3]
>
> list=array[0]+ array[3]+ array[4]
>
> list: [a,1,2]
>
> When I do it like this: list=array[0]+ array[3]+ array[4] I get an error:
>
> "TypeError: unsupported operand type(s) for +: 'numpy.ndarray' and 
> 'numpy.ndarray'"

 You're calculating a+1+2. Probably a isn't something that can be added to 
1+2.

-- 
Bartc 




More information about the Python-list mailing list