简体   繁体   English

在 read_pickle 之后追加

[英]Append after read_pickle

I'm trying to open a pickle file, append it, and write it back out as a new save file, but when I open it later, it is always the same file.我试图打开一个泡菜文件,附加它,然后将它写回作为一个新的保存文件,但是当我以后打开它时,它总是同一个文件。 How do I append properly?我如何正确附加?

My code:我的代码:

OGFile = pd.read_pickle(file,compression=None)
OGFile.append(data)
OGFile.to_pickle(file)

The second line should be:第二行应该是:

OGFile = OGFile.append(data)

The append() method doesn't change the DataFrame object 'inplace'. append()方法不会更改 DataFrame 对象“就地”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM