df.to_msgpack('ixto.msg')
我已经确认文件已保存在目录中,但是由于以下代码,我无法将msgpack库用于python:
unp = msgpack.unpackb('ixto.msg')
给我以下错误:
AttributeError: 'str' object has no attribute 'read'
因此,您需要先阅读文件:
with open('ixto.msg', 'rb') as f:
unp = msgpack.unpackb(f.read())