Re: Keeping two lists aligned after processing

2008-05-11 Thread Terry Reedy
"Paul Rubin" <"http://phr.cx"@NOSPAM.invalid> wrote in message news:[EMAIL PROTECTED] | philly_bob <[EMAIL PROTECTED]> writes: | > algs=['AlgA', 'AlgB', 'AlgC', 'AlgD', 'AlgE'] | > accs=[] | > for alg in algs: | >thisacc=getattr(alg.accuracy)() |> # picked this technique on comp.lang.python l

Re: Keeping two lists aligned after processing

2008-05-10 Thread philly_bob
On May 11, 2:32 am, Paul Rubin wrote: > philly_bob <[EMAIL PROTECTED]> writes: > > algs=['AlgA', 'AlgB', 'AlgC', 'AlgD', 'AlgE'] > > accs=[] > > for alg in algs: > >thisacc=getattr(alg.accuracy)() # picked this technique on > > comp.lang.python last month > >acc

Re: Keeping two lists aligned after processing

2008-05-10 Thread Dan Bishop
On May 11, 1:22 am, philly_bob <[EMAIL PROTECTED]> wrote: > > 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

Re: Keeping two lists aligned after processing

2008-05-10 Thread Paul Rubin
philly_bob <[EMAIL PROTECTED]> writes: > algs=['AlgA', 'AlgB', 'AlgC', 'AlgD', 'AlgE'] > accs=[] > for alg in algs: >thisacc=getattr(alg.accuracy)() # picked this technique on > comp.lang.python last month >accs.append(thisacc) I think what you mean is (untested): algs = [AlgA, Alg

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,