```python >>> arr = ndtest(3) >>> arr.sum_by('a') 3 ``` There is an ugly workaround but that is not user-friendly at all: ```python >>> arr.expand('b=b0').sum_by('a') a a0 a1 a2 0 1 2 ```