如何将创建的数据集保存到本地

最近刚开始学习可视化,自己根据网上的教程创建了一个数据集,想将它保存到本地,但是错误提示AttributeError: 'str' object has no attribute 'to_frame'

img

img

试试

data.to_csv(r'E:/PP/boston.csv',index=False)