I have 5 lists that contain some data:
a = [52, 265, 1, 98, 26]
b = [42, 85, 45, 2, 3, 8, 632]
c = [7, 731, 92, 65, 28, 62]
d = [3, 5, 44, 55]
e = [15, 35, 850, 6, 18, 41]
What I want to do is get the sum of the values of every possible combination, for example:
a[0] + b[0] + c[0] + d[0] + e[0] = **121**
...
a[4] + b[6] + c[5] + d[3] + e[5] = **816**
This needs to be done is the fastest way possible, because in my code the length of these lists is bigger, thus making the calculation of all possibilities extremely time demanding.
My first idea was using nested for loops, but that's not fast enough. I imagine some transformations and some magic could be done with NumPy to speed up this process.