This is what my variable, call it A
, looks like in MATLAB (only 10 cells):
Then, this is what the first cell 1,1 looks like (goes on for 20 cells):
Then, this is what the first cell of that image looks like (goes on for 32 cells):
And, I want to make a .npy
file that when loaded and saved as variable data
& then printed, looks like this:
How can I transfer the .mat
file to a .npy
so that when I load it, it looks like above?
scipy.io.loadmat
? Or are you trying to creat the equivalent innumpy
from scratch?x=np.zeros((10,20,30))
should have the desired shape. You could then set a subset of the elements withx[:,n:,n:] = 1
.