def mean(self, values, axis=0, weights=None, dtype=None):
    'compute the mean over each group\n\n        Parameters\n        ----------\n        values : array_like, [keys, ...]\n            values to take average of per group\n        axis : int, optional\n            alternative reduction axis for values\n        weights : ndarray, [keys, ...], optional\n            weight to use for each value\n        dtype : output dtype\n\n        Returns\n        -------\n        unique: ndarray, [groups]\n            unique keys\n        reduced : ndarray, [groups, ...]\n            value array, reduced over groups\n        '
    values = np.asarray(values)
    if (weights is None):
        result = self.reduce(values, axis=axis, dtype=dtype)
        shape = ([1] * values.ndim)
        shape[axis] = self.groups
        weights = self.count.reshape(shape)
    else:
        weights = np.asarray(weights)
        result = self.reduce((values * weights), axis=axis, dtype=dtype)
        weights = self.reduce(weights, axis=axis, dtype=dtype)
    return (self.unique, (result / weights))
compute the mean over each group

Parameters
----------
values : array_like, [keys, ...]
    values to take average of per group
axis : int, optional
    alternative reduction axis for values
weights : ndarray, [keys, ...], optional
    weight to use for each value
dtype : output dtype

Returns
-------
unique: ndarray, [groups]
    unique keys
reduced : ndarray, [groups, ...]
    value array, reduced over groups
def mean(self, values, axis=0, weights=None, dtype=None):
    'compute the mean over each group\n\n        Parameters\n        ----------\n        values : array_like, [keys, ...]\n            values to take average of per group\n        axis : int, optional\n            alternative reduction axis for values\n        weights : ndarray, [keys, ...], optional\n            weight to use for each value\n        dtype : output dtype\n\n        Returns\n        -------\n        unique: ndarray, [groups]\n            unique keys\n        reduced : ndarray, [groups, ...]\n            value array, reduced over groups\n        '
    values = np.asarray(values)
    if (weights is None):
        result = self.reduce(values, axis=axis, dtype=dtype)
        shape = ([1] * values.ndim)
        shape[axis] = self.groups
        weights = self.count.reshape(shape)
    else:
        weights = np.asarray(weights)
        result = self.reduce((values * weights), axis=axis, dtype=dtype)
        weights = self.reduce(weights, axis=axis, dtype=dtype)
    return (self.unique, (result / weights))