Use np.mgrid[0:3, 0:4] and return just the row-number grid

NumPy · from Coordinate grids

np.meshgridnp.mgridnp.ogridnp.indicesnp.hypotsparse grids

Putting the kettle on…

Starting up…

Exercise 2

Use np.mgrid[0:3, 0:4] and return just the row-number grid.

your answer
stuck? the lesson behind it
Coordinate grids
meshgrid, mgrid, ogrid — how you compute a function of position without a loop.