As I understand the question, what you mainly want is a numpy substitute for itertools.product(). The nearest analogue in numpy would be numpy.indices(). If we modify the code sample in the question just slightly, in order to show us what output it is that we will need to be able to reproduce when working purely in numpy:
indexes = itertools.product(range(3), repeat=3)
for coordinates in indexes:
print(coordinates)
we get the following result:
(0, 0, 0)
(0, 0, 1)
(0, 0, 2)
(0, 1, 0)
(0, 1, 1)
(0, 1, 2)
(0, 2, 0)
(0, 2, 1)
(0, 2, 2)
(1, 0, 0)
(1, 0, 1)
(1, 0, 2)
(1, 1, 0)
(1, 1, 1)
(1, 1, 2)
(1, 2, 0)
(1, 2, 1)
(1, 2, 2)
(2, 0, 0)
(2, 0, 1)
(2, 0, 2)
(2, 1, 0)
(2, 1, 1)
(2, 1, 2)
(2, 2, 0)
(2, 2, 1)
(2, 2, 2)
The following code sample will reproduce this result line-for-line exactly, using numpy.indices() instead of itertools.product():
import numpy
a, b, c = numpy.indices((3,3,3))
indexes = numpy.transpose(numpy.asarray([a.flatten(), b.flatten(), c.flatten()]))
for coordinates in indexes:
print(tuple(coordinates))