Simple list problem that's defeating me!

Neil Webster nswebster at gmail.com
Thu Jun 24 05:21:10 EDT 2010


Thanks for the help so far.

The background to the problem is that the lists come from reading a
dbf file.  The code that I am trying to write is to merge lines of the
dbf based on the first column.  So in my example there would be three
lines:
a 2 3 4
b 10 11 12
a 2 3 4

The expected output from the above example lines would be:
a 4 6 8
b 10 11 12

 ... and the lines are read as: [[a,2,3,4],[b,10,11,12], [a,2,3,4]]

In response to not posting working code or actual inputs, ummm, that's
why I am asking the question here.








On Jun 22, 4:38 pm, Bruno Desthuilliers <bruno.
42.desthuilli... at websiteburo.invalid> wrote:
> Neil Webster a crit :
>
> > Hi all,
>
> > I've got a simple problem but it's defeated me and I was wondering if
> > somebody could point out where I'm going wrong
>
> 1/ not posting working code (got a NameError)
> 2/ not posting the expected output
> 3/ not posting the actual output
>
> > or offer an alternative
> > solution to the problem?
>
> When you'll have fixed the 3 problems listed above !-)
>
> (snip broken code)




More information about the Python-list mailing list