I have an application where I need to sum across arbitrary groups of indices in a 3D NumPy array. The built-in NumPy array sum routine sums up all indices along one of the dimensions of an ndarray. Instead, I need to sum up ranges of indices along one of the dimensions in my array and return a new array.

For example, let's assume that I have an ndarray with shape `(70,25,3)`. I wish to sum up the first dimension along certain index ranges and return a new 3D array. Consider the sum from `0:25, 25:50` and `50:75` which would return an array of shape `(3,25,3)`. 

Is there an easy way to do "disjoint sums" along one dimension of a NumPy array to produce this result?