1>>> import numpy as np
2>>> i_coords, j_coords = np.meshgrid(range(5), range(4), indexing='ij')
3>>> i_coords
4array([[0, 0, 0, 0],
5 [1, 1, 1, 1],
6 [2, 2, 2, 2],
7 [3, 3, 3, 3],
8 [4, 4, 4, 4]])
9>>> j_coords
10array([[0, 1, 2, 3],
11 [0, 1, 2, 3],
12 [0, 1, 2, 3],
13 [0, 1, 2, 3],
14 [0, 1, 2, 3]])
15