Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #44115

Re: Lists and arrays

From "BartC" <bc@freeuk.com>
Newsgroups comp.lang.python
References <de1cc79e-cbf7-4b0b-ae8e-18841a1ef095@googlegroups.com>
Subject Re: Lists and arrays
Message-ID <JVhdt.49368$8L4.10144@fx29.fr7> (permalink)
Organization virginmedia.com
Date 2013-04-22 22:24 +0100

Show all headers | View raw



"Ana Dionísio" <anadionisio257@gmail.com> wrote in message 
news:de1cc79e-cbf7-4b0b-ae8e-18841a1ef095@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 

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Lists and arrays Ana Dionísio <anadionisio257@gmail.com> - 2013-04-22 11:13 -0700
  Re: Lists and arrays Dave Angel <davea@davea.name> - 2013-04-22 14:34 -0400
  Re: Lists and arrays "BartC" <bc@freeuk.com> - 2013-04-22 22:24 +0100
  Re: Lists and arrays 88888 Dihedral <dihedral88888@googlemail.com> - 2013-04-23 00:50 -0700
  Re: Lists and arrays Denis McMahon <denismfmcmahon@gmail.com> - 2013-04-23 19:30 +0000

csiph-web