Re: Convert namedtuple to dictionary

2013-09-26 Thread Virendra Tripathi
Thanks guys! BTW, please ignore the follow-up question there. I had written a script earlier which had a dict like: {'a':[x=10, y=23,..], 'b': [x=10, y=23,…],…..} I was thinking about that and therefore the error. Apologies. -- https://mail.python.org/mailman/listinfo/python-list

Re: Convert namedtuple to dictionary

2013-09-26 Thread Virendra Tripathi
Hi Ned, Thanks. Wouldn't I have to first create a function to pull out the 'dictdict' from the data? I assume 'dictdict' refers to the 'brucelee' named tuple in the example. That's where I was getting stuck-trying to pull out the named tuples from the dict and operate on it. Thanks, Virendra

Re: Convert namedtuple to dictionary

2013-09-26 Thread Virendra Tripathi
Hi MRAB, Thanks. Learning a lot thanks to you guys. I should have mentioned that the data is dynamic, in the sense that 'brucelee' could be 'jackiechan' , the number of named tuples - i.e., 'brucelee(…)', could change as well, the next time data is pulled in. The format of the data would howev

Re: Convert namedtuple to dictionary

2013-09-26 Thread Virendra Tripathi
Thx Tim. Your solution works. I am, as you can probably tell, a newbie at Python. -- https://mail.python.org/mailman/listinfo/python-list