且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Matlab中,如何读取python pickle文件?

更新时间:2022-06-19 01:37:13

我最终从.p文件中读取了数据:

I ended up with read the data back from the .p file:

[whatever_data]=pickle.load( open( "myallData.p", "rb" ) )

然后使用scipy将数据转换并保存到.mat

Then use scipy to convert and save the data to .mat

import numpy, scipy.io
scipy.io.savemat('/home/myfiles/mydata.mat', mdict={'whatever_data': whatever_data})

为避免与泡菜打交道.