In numpy is there a fast way of calculating the mean across multiple axis? I am calculating the mean on all but the 0 axis of an n-dimensional array.

I am currently doing this;

for i in range(d.ndim - 1):
    d = d.mean(axis=1)

I'm wondering if there is a solution that doesn't use a python loop.

Edit
Report