numpy 2d array meshgrid

Solutions on MaxInterview for numpy 2d array meshgrid by the best coders in the world

showing results for - "numpy 2d array meshgrid"
Abigail
29 Jan 2019
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
similar questions
queries leading to this page
numpy 2d array meshgrid