I know that it is very simple, and I can’t believe that I didn’t find anything in this place, but here it is:
I have a large dimensional matrix in python that I want to save in .mat format (for matlab). I use the scipy.io.savemat method to save this matrix, but it is always saved as double. I would like to keep it as something of a lower accuracy, for example, single or 16-bit swimming.
I convert the array to a low current data type before saving, but it is always saved as double. Is there no way to save mat files in floating point mode with less accuracy?
.savemat does not seem to accept the dtype argument.
import scipy as sp
sp.io.savemat('test.mat', {'test': sp.array([0.001, 1, 1.004], dtype='Float16')})
source
share