tacco.sum

sum(X, axis, dtype=None)

Calculates the sum of a sparse matrix or array-like in a specified axis and returns a flattened result.

Parameters:
  • X – A 2d ndarray or a scipy sparse matrix.

  • axis – The axis along which to calculate the sum

  • dtype – The dtype used in the accumulators and the result.

Returns:

The flattened sums as 1d ndarray.