Saving dictionary of header information using numpy.savez()
问题 I am trying to save an array of data along with header information. Currently, I am using numpy.savez() to save the header information (a dictionary) in one array, and the data in another. data = [[1,2,3],[4,5,6]] header = {'TIME': time, 'POSITION': position} np.savez(filename, header=header, data=data) When I try to load and read the file, however, I can't index the header dictionary. arrays = np.load(filename) header = arrays('header') data = arrays('data') print header['TIME'] I get the