Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #44164
| Newsgroups | comp.lang.python |
|---|---|
| Date | 2013-04-23 00:50 -0700 |
| References | <de1cc79e-cbf7-4b0b-ae8e-18841a1ef095@googlegroups.com> |
| Message-ID | <155ef657-aaff-4b31-aa55-ba76cdd179d7@googlegroups.com> (permalink) |
| Subject | Re: Lists and arrays |
| From | 88888 Dihedral <dihedral88888@googlemail.com> |
Ana Dionísio於 2013年4月23日星期二UTC+8上午2時13分38秒寫道: > 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'" > > > > Can you help me? The list part in Python is more versatile but definitely executed slower than the array in C. What I like is that maintaining the Python part is not as tedious and painful for the same programs in LISP.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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