sum()
Calculates the sum of a sparse matrix or array-like in a specified axis and returns a flattened result.
X – A 2d ndarray or a scipy sparse matrix.
ndarray
axis – The axis along which to calculate the sum
dtype – The dtype used in the accumulators and the result.
The flattened sums as 1d ndarray.