On a 9 x 9 grid, return an integer array that is 1 where the distance from (4,…

NumPy · from Coordinate grids

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

Putting the kettle on…

Starting up…

Exercise 3

On a 9 x 9 grid, return an integer array that is 1 where the distance from (4, 4) is less than 3, and 0 elsewhere.

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