Answers for "how to to get sum of column or row in numpy"

2

how to to get sum of column or row in numpy

np.sum([[0, 1], [0, 5]], axis=0)
#array([0, 6])

np.sum([[0, 1], [0, 5]], axis=1)
#array([1, 5])
Posted by: Guest on March-06-2021

Code answers related to "how to to get sum of column or row in numpy"

Browse Popular Code Answers by Language