May-11-2017, 12:09 AM
Hi, guys,
I have a numpy array of (2,100,2) dimensions, that I want to sum elements of the same position. In order to clarify my doubts, I wrote the example below where I substituted the numbers by letters with dimensions (2,2,2):
So, I look for a way to sum a+a, b+b, c+c, d+d, and obtain an array with dimensions (2,2,1). Here's the desired output:
I'd like something that I can extrapolate to cases with dimensions (2,100,X), where X can be numbers from 2 to 10.
Thanks !!!
I have a numpy array of (2,100,2) dimensions, that I want to sum elements of the same position. In order to clarify my doubts, I wrote the example below where I substituted the numbers by letters with dimensions (2,2,2):
1 2 3 4 |
[[[a b] [c d]] [[a b] [c d]]] |
1 2 |
[[a + a b + b] [c + c d + d]] |
Thanks !!!