'DataFrame' object has no attribute 'save' 已解决

在使用pikcle尽心序列化的时候,保存最终文件用save方法,但是df中无此方法,原因是版本问题,只需要将save用to_pickle方法代替即可。同理,load要替换为read_pickle

aaa = open(r'C:\Users\hahaha\.spyder-py3\pydata-book-2nd-edition\examples\ex1.csv',encoding='utf-8')

frame = pd.read_csv(aaa)

frame.save(r'C:\Users\hahaha\.spyder-py3\pydata-book-2nd-edition\examples\frame_pickle.csv',encoding='utf-8')


AttributeError: 'DataFrame' object has no attribute 'save'

你可能感兴趣的:(python)