I get some tuples from fetching from MySQLdb like this:
((2L, 0.904672), (2L, 0.816745), (2L, 1.07916), (31L, 0.874432), (31L, 1.13517), (31L, 0.737347), (11L, 0.507236), (11L, 0.946989), (11L, 0.816373).....)
There are some duplicate values like 2L
,31L
and 11L
. I want to use the values as keys of my dict
what i want to ask is how to convert this tuples to dict with array values based from the keys?
so what i want to make is like this:
{'2L':[0.904672,0.816745,1.07916], '31L':[0.874432,1.13517,0.737347],'11L':[0.507236,0.946989,0.816373],..........}
any help would be appreciated :)