血泪教训!!!
问题:
一开始想使用scipy.io保存.mat文件(sio.savemat()),但是疯狂报错MatWriteError: Matrix too large to save with Matlab 5 format,欲哭无泪,想存储万级别的行×十万级别的列的cell×peak矩阵和cell×gene矩阵,真的好大的矩阵啊!!!存储非常大的矩阵怎么处理,困扰我一周!!!中途还被带偏去安装了linux版的matlab,呜呜呜…
解决方案:
使用hdf5storage.savemat()即可
pip install hdf5storage
import hdf5storage
hdf5storage.savemat('/home/Jupyter_Notebook_data_and_op/Multiomics_data/same_cell_ATAC_RNA/An_ultra/Adult_Cerebrail_Cortex/An_ultra_Adult_30.mat', {'X':X, 'Y':Y},do_compression=True,format='7.3')
大功告成!!!开心心,我爱hdf5storage!!!