merge 2 arrays

hakim ouaras hakim_ouaras at yahoo.com
Fri Jan 18 13:13:19 EST 2008


Hi all,

I have two dictionays like these:
dict1={"id1":[1,2,3,4,5],"id2":[1,2,3,1,3], "var1":[10,11,12,13,14]}
dict2={"id2":[1,2,3,4,], "var2":[20,21,22,23]}
I want to replace the values of dict1["var1"] with those of dict["var2"] with taking count the correspondance between dict1["id1"]  and dict2["id2"].
result that I want to have is like this:
dict1={"id1":[1,2,3,4,5],"id2":[1,2,3,1,3], "var1":[20,21,22,20,22]}

Thak you
Hakim







      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080118/41e182dc/attachment.html>


More information about the Python-list mailing list