Array construction from object members
- From: "MKoool" <mohankhurana@xxxxxxxxx>
- Date: 31 Dec 2005 09:01:44 -0800
Hi everyone,
I am doing several operations on lists and I am wondering if python has
anything built in to get every member of several objects that are in an
array, for example, if i have a class like the following:
class myClass:
a = 0.0
And lets say I populate the "a" element in an array of objects of
myClass. If I want to retrieve all items in this and perhaps give it
to a mean function, I would need to make a loop now:
mySimpleArray = []
for i in range(0,len(myArray)):
mySimpleArray.append(myArray[i].a)
There must be some more efficient way to do this, can someone point me
to the right direction so that I can review some documentation and get
things a little more efficient?
thanks!
.
- Follow-Ups:
- Re: Array construction from object members
- From: Paul McGuire
- Re: Array construction from object members
- From: Gerard Flanagan
- Re: Array construction from object members
- Prev by Date: bsddb3 locking questions
- Next by Date: Re: Array construction from object members
- Previous by thread: bsddb3 locking questions
- Next by thread: Re: Array construction from object members
- Index(es):
Relevant Pages
|