I have a 4d array x, for which I want to loop through the first axis, modify that 3d array, and add this modified array to a new 4d array y.
I am currently doing something like:
xmod = modify(x[0, :, :, :])
y = xmod.reshape(1, x.shape[1], x.shape[2], x.shape[3])
for i in range(1, x.shape[0]):
    xmod = modify(x[i, :, :, :])
    y = np.vstack((y, xmod))
I am guessing there is amuch cleaner to do this. How?
modifyoperate in a vectorized manner on all ofx?modifyis really the resizing of an image:xmod = scipy.misc.imresize(x[i,:,:,0], 1.3). I don't thinkimresizecan be vectorized, but maybe I'm wrong?