Re: Keeping two lists aligned after processing

2008-05-10 Thread philly_bob
On May 11, 2:32 am, Paul Rubin <http://[EMAIL PROTECTED]> wrote: > philly_bob <[EMAIL PROTECTED]> writes: > > algs=['AlgA', 'AlgB', 'AlgC', 'AlgD', 'AlgE'] > > accs=[] > > for alg in algs: > >thi

Keeping two lists aligned after processing

2008-05-10 Thread philly_bob
""" I have a population of five algorithms. Each Alg has a method, Alg.accuracy(), which calculates its accuracy. Running the accuracy method on each Alg, I end up with a list of accuracies like [0.75, 0.10, 0.45, 0.80, 0.45] Now I want to store the algorithms and associated accuracies in a file,

Keeping two lists aligned after processing

2008-05-10 Thread philly_bob
""" I have a population of five algorithms. Each Alg has a method, Alg.accuracy(), which calculates its accuracy. Running the accuracy method on each Alg, I end up with a list of accuracies like [0.75, 0.10, 0.45, 0.80, 0.45] Now I want to store the algorithms and associated accuracies in a file,

Re: Random/anonymous class methods

2008-05-05 Thread philly_bob
On Apr 27, 8:05 am, philly_bob <[EMAIL PROTECTED]> wrote: > In the sample program below, I want to send a random method to a class > instance. > In other words, I don't know which method to send until run-time. How > can I send ch, which is my random choice, to the mycla

Random/anonymous class methods

2008-04-27 Thread philly_bob
In the sample program below, I want to send a random method to a class instance. In other words, I don't know which method to send until run-time. How can I send ch, which is my random choice, to the myclass instance? Thanks, Bob= import random class myclass(object): def meth1(self):