I have the next code on Matlab:
cols = 7;
rows = 8;
redGrd = [0 0 0 0 0 1; 1 1 1 1 0 1; 0 0 0 0 0 1; 1 0 1 1 0 1];
redGrd(:,1)=-9999;
redGrd(1,:)=-9999;
redGrd(:,cols)=-9999;
redGrd(rows,:)=-9999
this is the result for matlab:
-9999 -9999 -9999 -9999 -9999 -9999 -9999
-9999 1 1 1 0 1 -9999
-9999 0 0 0 0 1 -9999
-9999 0 1 1 0 1 -9999
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
-9999 -9999 -9999 -9999 -9999 -9999 -9999
I want to do the same on python using numpy then I do this:
import numpy as np
cols = 7
rows = 8
redGrd = np.array([[0,0,0,0,0,1],[1,1,1,1,0,1],[0,0,0,0,0,1],[1,0,1,1,0,1]])
redGrd[:,0] = -9999
redGrd[0,:] = -9999
redGrd[:,cols] = -9999
redGrd[rows,:] = -9999
But the two last command dont works.