In the following code:
from collections import defaultdict
confusion_proba_dict = defaultdict(float)
for i in xrange(10):
confusion_proba_dict[i] = i + 10
print confusion_proba_dict
Output is:
defaultdict(<type 'float'>, {0: 10, 1: 11, 2: 12, 3: 13, 4: 14, 5: 15, 6: 16, 7: 17, 8: 18, 9: 19})
But, I need output to be:
{0: 10, 1: 11, 2: 12, 3: 13, 4: 14, 5: 15, 6: 16, 7: 17, 8: 18, 9: 19}
How can I do it?