假设我的压缩文件Data.zip里有一个名为sub_0.hdf
的文件,我要把它读取出来,则用下列语句,同样的像txt, csv同理。
from zipfile import ZipFile
myZip = ZipFile("C:\\Users\\*****\\Desktop\\DeapCode\\PreparedData\\Data.zip")
myFile = myZip.open("Data/sub_1.hdf")
dataDictionary = h5py.File(myFile, 'r')
data = dataDictionary['data']
print(data.shape)