Could use `(-1,)` instead of `(np.prod(a.shape[nkeep:]),)`.