I am not sure I like the resize. The old code looks OK on first sight, so adding the typing should be fine (as noted above). This should be `np.intp` here as well. `int` (C long) is not guaranteed to be able to hold the result on windows machines. (`ma.sum(axis, dtype=np.intp)` may be a bit nicer, too. Though probably slower for small arrays at the moment at least)