Convert namedtuple to dictionary

Virendra Tripathi virendra.tripathi at maansystems.com
Thu Sep 26 13:13:47 EDT 2013


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 however remain the same.

I am using @Tim Chase's solution for now. 

Your solution will also work but I think I'll need to create a fn to pull out the " n " values as in: ">>> n = brucelee(x=123, y=321)"

Thanks,

Virendra






More information about the Python-list mailing list