Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.071 X-Spam-Evidence: '*H*': 0.86; '*S*': 0.00; 'guys.': 0.09; 'dynamic,': 0.16; 'i.e.,': 0.16; 'received:169.254.11': 0.16; 'subject:Convert': 0.16; 'thanks,': 0.17; 'thanks.': 0.20; 'to:name:python-list@python.org': 0.22; 'values': 0.27; "skip:' 10": 0.31; 'tuples': 0.31; 'received:169.254': 0.32; 'sense': 0.34; 'could': 0.34; 'but': 0.35; 'in.': 0.36; 'in:': 0.36; 'next': 0.36; 'thanks': 0.36; "i'll": 0.36; 'should': 0.36; 'received:169': 0.37; 'received:10': 0.37; 'same.': 0.38; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'mentioned': 0.61; 'charset:windows-1252': 0.65; 'received:10.242': 0.84 From: Virendra Tripathi To: "python-list@python.org" Subject: Re: Convert namedtuple to dictionary Thread-Topic: Convert namedtuple to dictionary Thread-Index: AQHOutvDw6fJGBLE50m0NY8GAfmLOg== Date: Thu, 26 Sep 2013 17:13:47 +0000 Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [64.71.23.190] x-forefront-prvs: 0981815F2F x-forefront-antispam-report: SFV:NSPM; SFS:(199002)(189002)(164054003)(83322001)(80976001)(74706001)(74662001)(4396001)(74502001)(31966008)(46102001)(47976001)(47446002)(74876001)(65816001)(80022001)(81816001)(33656001)(81686001)(81342001)(81542001)(63696002)(47736001)(49866001)(53806001)(69226001)(56776001)(54316002)(77096001)(83072001)(74366001)(66066001)(76796001)(76482001)(56816003)(76786001)(51856001)(82746002)(77982001)(50986001)(36756003)(76176001)(59766001)(79102001)(54356001)(83716002); DIR:OUT; SFP:; SCL:1; SRVR:BY2PR04MB255; H:BY2PR04MB255.namprd04.prod.outlook.com; CLIP:64.71.23.190; FPR:; RD:InfoNoRecords; A:1; MX:1; LANG:en; Content-Type: text/plain; charset="Windows-1252" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: maansystems.com X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1380215641 news.xs4all.nl 15951 [2001:888:2000:d::a6]:43825 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:54841 Hi MRAB, Thanks. Learning a lot thanks to you guys. I should have mentioned that the data is dynamic, in the sense that 'brucel= ee' could be 'jackiechan' , the number of named tuples - i.e., 'brucelee(= =85)', 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.=20 Your solution will also work but I think I'll need to create a fn to pull o= ut the " n " values as in: ">>> n =3D brucelee(x=3D123, y=3D321)" Thanks, Virendra