Inverse of dict(zip(x,y))

Tino Wildenhain tino at wildenhain.de
Fri Mar 6 14:28:05 CET 2009


Andre Engels wrote:
> On Thu, Mar 5, 2009 at 7:46 PM, Andre Engels <andreengels at gmail.com> wrote:
> 
>> If the dict = {key1: val1, key2: val2, ...}, you can do:
>>
>> for key in dict:
>>    plot(key,dictionary[key])
> 
> Of course I meant:

> for key in dict:
>    plot(key,dict[key])

Which would be the verbose form of:

for x,y in datadict.items():
     plot(x,y)

T.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3241 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20090306/5297f65c/attachment.bin>


More information about the Python-list mailing list