import numpy as np
matrix = np.matrix([[1, 2, 3], [4, 4, 6]])
print(matrix)
sum_of_rows = np.sum(matrix, axis = 1)
print("Sum of rows =\n", sum_of_rows)
sum_of_cols = np.sum(matrix, axis = 0)
print("Sum of columns =", sum_of_cols)
'''
run:
[[1 2 3]
[4 4 6]]
Sum of rows =
[[ 6]
[14]]
Sum of columns = [[5 6 9]]
'''