”’

Created on Apr 23, 2017

Add all elements of the array and using Axis

@author: asharda

”’

import numpy as np

num=np.array([[1,2],[3,4]])

print(np.sum(num))#Print 10

print(np.sum(num,axis=0))#Print [4,6]

print(np.sum(num,axis=1))#Print [3,7]

### Like this:

Like Loading...

*Related*

## About qainterviews

Software Geek,QA Expert,Blogger