I have something like the following dictionary:
dict = {}
dict[(-1,"first")]=3
dict[(-1,"second")]=1
dict[(-1,"third")]=5
dict[(0,"first")]=4
dict[(0,"second")]=6
dict[(0,"third")]=7
dict[(1,"first")]=34
dict[(1,"second")]=45
dict[(1,"third")]=66
dict[(2,"first")]=3
dict[(2,"second")]=1
dict[(2,"third")]=2
What I would like now is a dict with the following structure: Keys are "first" "second" "third", values are the numbers --> start: if first entry in tuple > 0
dict_1 ={"first": [4,34,3], "second": [6,45,1], "third": [7,66,2]}
I tried it with:
for key, value in dict.iteritems():
if key[0] <=0:
..
..
But that changes the order and does not work really properly. Would be great if anyone would suggest a simple method to handle such things.
Thank you very much