sum matrix python code example
Example 1: python sum of list axes
>>> np.sum([[0, 1], [0, 5]])
6
>>> np.sum([[0, 1], [0, 5]], axis=0)
array([0, 6])
>>> np.sum([[0, 1], [0, 5]], axis=1)
array([1, 5])
Example 2: python sum whole matrix comand
x = np.matrix([[1, 2], [4, 3]])
>>> x.sum()