Would `np.rollaxis` work here?