self.F=1+0.01*np.random.random((6,res,res,5)).astype(self.precision)])
self.cx = [ 0, 1, 0, -1, 0]
self.cy = [ 0, 0, -1, 0, 1]
[...]
for a in range(6):
for i in range(0,5):
self.newF[a,:,:,i]=np.roll(self.F[a,:,:,i],(self.cy[i],self.cx[i]),axis=(0,1))
I have the following code, and this np.roll is really slow. Can anyone recommend a faster way?