4.7.7.1.1.4. statsmodels.tools.grouputils.group_sums_dummy

statsmodels.tools.grouputils.group_sums_dummy(x, group_dummy)[source]

sum by groups given group dummy variable

group_dummy can be either ndarray or sparse matrix