初学Python,遇到需要将mat文件转为csv文件,看了很多博客,最后找到了解决办法,代码如下:
#方法1
from pandas import Series,DataFrame
import pandas as pd
import numpy as np
import h5py
datapath = 'E:/workspacelxr/contem/data.mat'
file = h5py.File(datapath,'r')
file.keys()
def Print(name):print(name)
data = file['data'][:]
dfdata = pd.DataFr
1