python怎么查看mat格式的文件
【摘要】python查看mat格式文件的方法:首先输入“import mat4py”命令导入需要的模块;然后输入“mat4py loadmat(mat_path)”命令即可查看mat格式

python查看mat格式文件的方法:首先输入“import mat4py”命令导入需要的模块;然后输入“mat4py.loadmat(mat_path)”命令即可查看mat格式的文件。
方法一
import mat4py
mat4py.loadmat(mat_path)
方法二
import scipy.io as io
io.loadmat(mat_path)
前两种方法有时会因为mat文件格式level太高而报错,例如:NotImplementedError: Please use HDF reader for matlab v7.3 files
这时就需要第三种方法:
方法三
import h5py
mat = h5py.File(mat_path)
mat = np.transpose(mat['you_matrix_name_in_mat'])
推荐课程:Python基础视频教程(前端基础)
上一篇:python爬虫的工作步骤
下一篇:python怎么传送文件
就业培训申请领取


环球青藤
官方QQ群扫描上方二维码或点击一键加群,免费领取大礼包,加群暗号:青藤。 一键加群
最新文章
Python编程各地入口
环球青藤官方微信服务平台


刷题看课 APP下载
免费直播 一键购课
代报名等人工服务
Python编程热点排行