Let\'s assume I have a created a dict that is made up of n keys. Each key is mapped to a list of integers of a consistent length. What I want to make now is a new list that
Depending on your use-case you might want to consider using an adequate library for more general/complex functionality.
import numpy as np
my_dict = {'a': [1, 2, 3, 4], 'b': [2, 3, 4, 5], 'c': [3, 4, 5, 6]}
arr = np.array(list(d.values()))
# [[1 2 3 4]
# [2 3 4 5]
# [3 4 5 6]]
arr.sum(axis=0)
# [ 6 9 12 15]
import pandas as pd
my_dict = {'a': [1, 2, 3, 4], 'b': [2, 3, 4, 5], 'c': [3, 4, 5, 6]}
df = pd.DataFrame(my_dict)
# a b c
# 0 1 2 3
# 1 2 3 4
# 2 3 4 5
# 3 4 5 6
df.sum(axis=1)
# 0 6
# 1 9
# 2 12
# 3 15