There is a numpy array() with m x n size, and I want to get indexes that match a particular pattern.
Since the map would be bigger than the example below, I guess solving with loop is not efficient.

In this example, I want to get the following as result:
[
[(0, 0), (0, 1), (0, 2), (0, 3), (1, 0), (1, 1), (1, 2), (1, 3)],
[(1, 3), (1, 4), (1, 5), (1, 6), (2, 3), (2, 4), (2, 5), (2, 6)]
]
Is there any tool to do this easily?
mapis a standard Python function, so when you use that name as a variable, you are overwriting it.