This is a git tricky, but if I understand this correctly this could also be done like this:

```
np.indices(naxes_i).swapaxes(0, 2).reshape(np.prod(naxes_i), len(naxes_i))
```