我有一個數據框列表,我希望將其轉換為多個 csv。例子:List_Df = [df1,df2,df3,df4]for i in List_Df: i.to_csv("C:\\Users\\Public\\Downloads\\"+i+".csv")預期輸出:有 4 個 csv 文件,名稱為 df1.csv,df2.csv ...但我面臨兩個問題:第一個問題: AttributeError: 'list' object has no attribute 'to_csv'第二個問題:("C:\\Users\\Public\\Downloads\\"+ **i** +".csv") <- **i** returns the object as it's suppose to but I wish for python to automatically take the object_name and use it with .csv任何幫助將不勝感激,因為我是 Python 和 SOF 的新手。
添加回答
舉報
0/150
提交
取消