I need to slice a numpy array so that I obtain an array that corresponds to the dark green areas: array
The green area is the intersection of multiple ranges in the columns and the rows. I thought of something like:
M[[1:3,5:7],[1:3,5:7]]=np.zeros(4,4)
But it doesn't work. How can I do this efficiently?