I want to create a 3d array where basically the content is identical to the indeces used to access it. So m[2,5] would result in array([2, 5]).
I couldn't find an obvious solution with the numpy functions indices, ogrid, concatenate, etc.
At the moment I'm using this, but was wondering whether there is a solution that makes better use of the API:
a, b = 3, 4
m = np.ones((a, b, 2))
for x in range(a):
m[x,:, 1] = np.array(range(b))
for y in range(b):
m[:,y,0] = np.array(range(a))