numpy-groupies is a small library of optimised tools for doing things that can roughly be considered "group-indexing operations". The most prominent tool is aggregate, which is descibed in detail further down the page.