Okay, this is super basic, which unfortunately means that searching for it gives a bajillion hits that all do something different and / or more complex.
Consider this code:
shape = (10, 20)
indices = []
for i in range(shape[0]):
for j in range(shape[1]):
indices.append([i, j])
or alternatively indices = itertools.product(range(10), range(20)).
Now, I feel like there must be a simple numpy function that does the same? Something like
indices = np.indices_into_shape((10, 20))
Most of the index-generating functions I can find via search generate multiple arrays, like in meshgrid or ix_.