如何查看npz文件的字典内容

import numpy as np
data = np.load('homework.npz')
print(data.__dict__)

{'_files': ['X.npy', 'd.npy'], 'files': ['X', 'd'], 'allow_pickle': False, 'pickle_kwargs': {'encoding': 'ASCII', 'fix_imports': True}, 'zip': mode='r'>, 'f': , 'fid': <_io.BufferedReader name='homework.npz'>}

#读取字典内容
X = data[’X']
d = data['d']

你可能感兴趣的:(#,Numpy和Pandas,python)