If you're worried about memory efficiency, you could use `array.array('i')` instead of `list()` when `np.array(y[0]).dtype.kind == 'i'`.