Packs an array-of-arrays into an ndarray