python: Dictionary counter items. How to optimize performance
python: Dictionary counter items. How to optimize performance Question: I need to keep track of occurrences of items in parsed files in a structure as follows: data= {‘tomate’: {‘John’: 2, ‘mike’: 2}, ‘pasta’: {‘mike’: 1}, ‘wine’: {‘mike’: 1, ‘alex’: 2}} the dictionary starts as empty one. data = {} and its is being populated with …