I have a JSON file containing information as you can see in the attached file: Json File
I need some help creating a "Dictionary of genres" for each director like this: {GenreName: Number} where "Number" corresponds to the amount of films belonging to that genre the director "created".
E.g. checking "Sidney Lumet" the dictionary should be like this: {u'Drama': 2, u'War': 1, u'Adventure': 1, u'Thriller': 2, u'Crime': 1}
Since in the file you can read:
"Before the Devil Knows You're Dead;2007": {
"DIRECTORS": [
"Sidney Lumet"
],
"GENRES": [
"Crime",
"Drama",
"Thriller"
"Fail-Safe;1964": {
"DIRECTORS": [
"Sidney Lumet"
],
"GENRES": [
"Adventure",
"Drama",
"Thriller",
"War"
I explained wrongly what I needed in the title. My problem isn't about how to retrieve the information (I know about the json module and I know how to access its elements), but I need help creating that particular dictionary for each director.