How to calculate the column sum in Ipython?

ipython

#1

I have created a matrix in Ipython .I want to calculate the column sum of each column of a matrix in Ipython notebook just like in R for calculating column sum we can use the function colSums.Is there any function in python for performing the same task.

In [106]: arr
Out[106]:
array([[ 0, 1, 2, 3],
[ 4, 5, 6, 7],
[ 8, 9, 10, 11],
[12, 13, 14, 15],
[16, 17, 18, 19],
[20, 21, 22, 23],
[24, 25, 26, 27],
[28, 29, 30, 31]])

#2

@sid100158 You can do something like this arr.sum(axis=0) to get the column sum if you define arr to be a numpy array.

Hope this helps.

Regards,
Abhishek