You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I save a logical array in matlab with a length of 1 and a value of false, scipy.io.loadmat resturns an array with a value of True. This bug does not happen when the length of the logical array is larger than 1.
Reproducing code example:
In MATLAB I save a logical array with:
test = false;
save test.mat test
In Python, I then load the mat-file with:
import scipy.io as sio
mat = sio.loadmat('test.mat',matlab_compatible=True)
Error message:
This results in the following object in python
{'__globals__': [],
'__header__': b'MATLAB 5.0 MAT-file, Platform: PCWIN, Created on: Fri Mar 16 15:05:58 2018',
'__version__': '1.0',
'test': array([[ True]])}
As you can see, the value is now suddenly True. When I turn off matlab_compatible in loadmat, the value of 'test' will be 2, which is also incorrect.
If I save a logical array in matlab with a length of 1 and a value of false, scipy.io.loadmat resturns an array with a value of True. This bug does not happen when the length of the logical array is larger than 1.
Reproducing code example:
In MATLAB I save a logical array with:
In Python, I then load the mat-file with:
Error message:
This results in the following object in python
As you can see, the value is now suddenly True. When I turn off matlab_compatible in loadmat, the value of 'test' will be 2, which is also incorrect.
Scipy/Numpy/Python version information:
The text was updated successfully, but these errors were encountered: