ndim in numpy array loaded with scipy.io.loadmat?
问题 Using SciPy and MATLAB, I'm having trouble reconstructing an array to match what is given from a MATLAB cell array loaded using scipy.io.loadmat(). For example, say I create a cell containing a pair of double arrays in MATLAB and then load it using scipy.io (I'm using SPM to do imaging analyses in conjunction with pynifti and the like) MATLAB >> onsets{1} = [0 30 60 90] >> onsets{2} = [15 45 75 105] Python >>> import scipy.io as scio >>> mat = scio.loadmat('onsets.mat') >>> mat['onsets'][0]