np in this context is numpy.
z_mesh is array of shape 41*401.
I need dz_theta_mat and dz_gamma_mat of shape 20*200 by subtracting [2*i,2*j]th element from [2*i,2*j+2]th element and [2*i,2*j]th element from [2*i+2,2*j]th element respectively.
My attempt doesn't give the required shape for the list.
how do i modify it to obtain the required result?
print np.shape(z_mesh)
dz_gamma_mat = [z_mesh[2*i,2*j+2]-z_mesh[2*i,2*j] for i,j in itertools.product(range(20),range(199))]
print np.shape(fish_dz_gamma_mat)
dz_theta_mat = [z_mesh[2*i+2,2*j]-z_mesh[2*i,2*j] for i, j in itertools.product(range(19),range(200))]
print np.shape(fish_dz_theta_mat)
(41, 401)
(3980,)
(3800,)