Reputation: 537
Let A = np.ones([3,3,5])
.
Is there any linear algebra operation which will return
array([[ 9., 9., 9., 9., 9.]])
without any looping?
Upvotes: 0
Views: 395
Reputation: 282026
A.sum(axis=(0, 1))
Call the standard sum
routine with a tuple of axes to sum over.
Upvotes: 2