My dictionary looks like the below:
my_single_dictionary={
"totals": {"total": 26, "correct": 12, "false": 14, "correct_Percent": 46.15384615384615, "wrong_percent": 53.84615384615385},
"label": {"ADDRESS": {"total": 11, "correct": 2, "false": 9, "correct_Percent": 18.181818181818183, "wrong_percent": 81.81818181818183},
"NAME": {"total": 9, "correct": 6, "false": 3, "correct_Percent": 66.66666666666666, "wrong_percent": 33.33333333333333},
"DATE_TIME": {"total": 6, "correct": 4, "false": 2, "correct_Percent": 66.66666666666666, "wrong_percent": 33.33333333333333}}
}
Here is pseudo-code?
grand_sum_percentages={}
for new_dictiony in list_of_10_dictionaies:
similar_to_my_single_dictiony
# updating the percentage_correct and percentage_wrong based on the sum of wrong and correct of two dictionaries
for values in similar_to_my_single_dictiony.values():
values+my_single_dictionary.values()
some way to calculate the grand sum of `total`, `correct`,`false`
What do I want to do?
I have a list of dictionaries, a single dictionary looks like my_single_dictionary
I have percentage correct and percentage wrong for total and label {name, email, phone} wise.
Now in the loop, I want to get a grand sum of percentage for all the dictionaries not a single one.
My final dictionary should look like this:
{'totals': {'total': 2000,
'correct': 200,
'false': 1800,
'correct_Percent': xx.xx,
'wrong_percent': xx.xx},
'label': {'ADDRESS': {'total': 300,
'correct': 150,
'false': 150,
'correct_Percent': xx,
'wrong_percent': xx},
'NAME': {'total': 600,
'correct': 200,
'false': 400,
'correct_Percent': xxx,
'wrong_percent': xxx}}}