np.zeros((ny, nx)) code example Example: np.zeros((3,3)) >>> s = (3,3) >>> np.zeros(s) array([[ 0., 0.], [ 0., 0.]])