Python第三方库h5py_读取mat文件并显示值的方法
更新时间:2019-02-10 05:00:36 作者:佚名 我要评论(0)
mat数据格式是Matlab默认保存的数据格式。在Python中,我们可以使用h5py库来读取mat文件。
>>> import h5py
>>> data = h5py.File("**.mat")
>>> test = da
>>> import h5py
>>> data = h5py.File("**.mat")
>>> test = da
mat数据格式是Matlab默认保存的数据格式。在Python中,我们可以使用h5py库来读取mat文件。
>>> import h5py >>> data = h5py.File("**.mat") >>> test = data["digitStruct/name"] #<HDF5 dataset "name": shape (13068, 1), type "|O"> >>> st = test[0][0] #<HDF5 object reference> >>> obj = data[st] #<HDF5 dataset "b": shape (5, 1), type "<u2"> >>> str = "".join(chr(i) for i in obj[:]) >>> str '1.png'
以上这篇Python第三方库h5py_读取mat文件并显示值的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。
您可能感兴趣的文章:
- python中利用h5py模块读取h5文件中的主键方法
- Python读取mat文件,并转为csv文件的实例
最新评论