numpy.sum numpy.sum(a, axis=None, dtype=None, out=None, keepdims=False)[source] Sum of array elements over a given axis. Parameters: a : array_like Elements to sum. axis : None or int or tuple of ints, optional Axis or axes along which a sum is perfo…