I have a python dictionary. Just to give out context, I am trying to write my own simple cross validation unit.
So basically what I want is to get all the values exc
How about something along the following lines:
In [7]: d = dict((i,i+100) for i in xrange(10))
In [8]: d
Out[8]:
{0: 100,
1: 101,
2: 102,
3: 103,
4: 104,
5: 105,
6: 106,
7: 107,
8: 108,
9: 109}
In [9]: exc = set((2, 5))
In [10]: for k, v in d.items():
....: if k not in exc:
....: print v
....:
....:
100
101
103
104
106
107
108
109