dict(zip(desc,data)) isn't

dict(zip(desc,data)) isn't quite the right thing, as the keys are really just the first element of desc.

dict(zip([n[0] for n in desc],data)) would do the trick.

I'm just getting started with Python (converting a bag of PHP I've been carting around for ages), so please forgive any dopiness.

Thanks for the original post, which got me on the right track to fix up my code.

Ashok (not verified) – Mon, 2008 – 02 – 25 18:10

Reply

Please solve the math problem above and type in the result. e.g. for 1+1, type 2
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
More information about formatting options