Is there a less verbose alternative to this:
for x in xrange(array.shape[0]):
for y in xrange(array.shape[1]):
do_stuff(x, y)
I came up with this:
for x, y in itertools.product(map(xrange, array.shape)):
do_stuff(x, y)
Which saves one indentation, but is still pretty ugly.
I'm hoping for something that looks like this pseudocode:
for x, y in array.indices:
do_stuff(x, y)
Does anything like that exist?
for x, y in itertools.product(*map(xrange, array.shape)):