I would like to apply a mask all around the edges of an array, as example in a 3x3 array :
0 0 0
0 1 0
0 0 0
In stack i found this command, but i can t apply a second condition to get my specific array...
import numpy as np
np.logical_and.outer(np.arange(3) >= 2, np.arange(3) >= 2)
I get that :
0 0 0
0 0 0
0 0 1