Convert namedtuple to dictionary

Tim Chase python.list at tim.thechases.com
Thu Sep 26 13:22:49 EDT 2013


On 2013-09-26 16:42, Virendra Tripathi wrote:
> Thx Tim. Your solution works.

After Steven's reply, I recommend

  dict((k,v._asdict()) for k,v in d.iteritems())

which simplifies matters.

-tkc





More information about the Python-list mailing list