mlpy.stats.partitioned_sum¶
-
mlpy.stats.
partitioned_sum
(x, y, c=None)[source]¶ Sums of groups.
Groups the rows of x according to the class labels in y and sums each group.
Parameters: x : array_like, shape (n, dim)
The data to group, where n is the number of data points and dim is the dimensionality of each data point.
y : array_like, shape (n,)
The class label for each data point.
c : int
The number of components in y.
Returns: sums : array_like
The sum of each group.
Examples
>>> partitioned_sum()