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
To give more detail - the test pickle has a dictionary with values that are also dictionaries. These dictionaries have integers as keys. The scipy.io routines discard these, silently, because Matlab structs don't allow integers as fields:
>> struct(1, 'one')
Error using struct
Field names must be non-empty character vectors.
As a result, the thing that gets saved is:
In [23]: d2 = sio.loadmat('data.mat')
In [24]: d2
Out[24]:
{'__globals__': [],
'__header__': 'MATLAB 5.0 MAT-file Platform: posix, Created on: Wed May 22 10:57:44 2019',
'__version__': '1.0',
'v0': array([[None]], dtype=object),
'v1': array([[None]], dtype=object),
'v_post0': array([[None]], dtype=object),
'v_post1': array([[None]], dtype=object)}
pv
added
defect
A clear bug or issue that prevents SciPy from being installed or used as expected
scipy.io
labels
Aug 4, 2019
pv
changed the title
scipy.io.savemat save 400 B file
scipy.io.savemat silently discards bad dictionary keys
Aug 4, 2019
Nothing immediately springs to mind. Is there any container in Matlab that can deal with integer keys? I see that containers.Map will allow keys that aren't valid variable names, but I don't think it will allow integers.
I have a large (not complicated) dictionary that when I try to save it with sio.savemat I get 400 B file
Reproducing code example:
test.zip
Scipy/Numpy/Python version information:
The text was updated successfully, but these errors were encountered: