Hi Frank,
you can use Numeric.py it is also powerfull to handle averages, min, max, matrix algebra, etc..
You just need to use a list.
If your data is big and you need more power I suggest you use database like mysqldb for python.
It is also fun to combine database and python all together.
Cheers,
pujo
On 10/8/05, Frank Hoffsümmer <[EMAIL PROTECTED]> wrote:
Hello
I often find myself writing python programs to compute averages, min,
max, top10 etc of columns in a table of data
In these programs, I always capture each row of the table in a tuple
the table is then represented by a list of tuples
computing averages, min, max and other meta-information is then done
with for loops or some list comprehension.
now I wonder, whether I shouldn't be using classes instead of lists
to capture the table rows
with the little I know about classes, I assume that then I would have
a list of class instances as representation of my tabular data
but given such a list of class instances, i would still need for
loops to get to e.g. the minimal value of a certain attribute in all
classes in that list. OR?
and what would be the benefit of using classes then?
what is the best practice, can anyone shed some light on this
thanks
-frank
_______________________________________________
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor