I have tried zip
with a list of list and it worked.
data_list = [
[1, 2, 3],
[1, 3, 7],
[5, 8, 1]
]
total = [sum(x) for x in zip(*data_list)]
total
was as expected:
[7, 13, 11]
now I have dictionary
data_dict = {
'a': [1, 2, 3],
'b': [1, 3, 7],
'c': [5, 8, 1]
}
and I want exact same output as mentioned above. How can I do that with data_dict
?