In [5]: frame.save('frame_pickle') --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-5-f936768749d3> in <module>() ----> 1 frame.save('frame_pickle') D:\software\Python27\lib\site-packages\pandas\core\generic.pyc in __getattr__(se lf, name) 2358 return self[name] 2359 raise AttributeError("'%s' object has no attribute '%s'" % -> 2360 (type(self).__name__, name)) 2361 2362 def __setattr__(self, name, value): AttributeError: 'DataFrame' object has no attribute 'save'
上網查了好多,最后在API Reference文檔中發現
把save換成to_pickle就可以了。由於我pandas是0.17.1(http://pandas.pydata.org/pandas-docs/stable/api.html)版本,我又去該版本下查了一下,已經save方法的介紹了,只有to_pickle,只有在這0.13.1下才說明已經被Deprecated。
同樣的加載的方法load方法,也被Deprecated.采用read_pickle。