def reduce(self, values, operator=np.add, axis=0, dtype=None):
    'Reduce the values over identical key groups, using the given ufunc\n        reduction is over the first axis, which should have elements corresponding to the keys\n        all other axes are treated indepenently for the sake of this reduction\n\n        Parameters\n        ----------\n        values : ndarray, [keys, ...]\n            values to perform reduction over\n        operator : numpy.ufunc\n            a numpy ufunc, such as np.add or np.sum\n        axis : int, optional\n            the axis to reduce over\n        dtype : output dtype\n\n        Returns\n        -------\n        ndarray, [groups, ...]\n        values reduced by operator over the key-groups\n        '
    values = np.take(values, self.index.sorter, axis=axis)
    return operator.reduceat(values, self.index.start, axis=axis, dtype=dtype)
Reduce the values over identical key groups, using the given ufunc
reduction is over the first axis, which should have elements corresponding to the keys
all other axes are treated indepenently for the sake of this reduction

Parameters
----------
values : ndarray, [keys, ...]
    values to perform reduction over
operator : numpy.ufunc
    a numpy ufunc, such as np.add or np.sum
axis : int, optional
    the axis to reduce over
dtype : output dtype

Returns
-------
ndarray, [groups, ...]
values reduced by operator over the key-groups
def reduce(self, values, operator=np.add, axis=0, dtype=None):
    'Reduce the values over identical key groups, using the given ufunc\n        reduction is over the first axis, which should have elements corresponding to the keys\n        all other axes are treated indepenently for the sake of this reduction\n\n        Parameters\n        ----------\n        values : ndarray, [keys, ...]\n            values to perform reduction over\n        operator : numpy.ufunc\n            a numpy ufunc, such as np.add or np.sum\n        axis : int, optional\n            the axis to reduce over\n        dtype : output dtype\n\n        Returns\n        -------\n        ndarray, [groups, ...]\n        values reduced by operator over the key-groups\n        '
    values = np.take(values, self.index.sorter, axis=axis)
    return operator.reduceat(values, self.index.start, axis=axis, dtype=dtype)