from scipy.io import loadmat
dataMat=loadmat('data_label.mat')
# mat文件有很多不相关的keys,要找到目标的keys
print(dataMat.keys()) # 输出为dict_keys(['__header__', '__version__', '__globals__', 'data', 'label'])
data=dataMat['data']
label=dataMat['label']
print(type(data)) # <class 'numpy.ndarray'>
# print(label)
# print(data)
网友评论