[英]Python pandas how to write data from an array in excel
我無法從Excel中的數組寫入數據。
您需要什么參數來指定DataFrame()
函數?
import pandas as pd
table = pd.read_excel("file1.xlsx", sheetname="file1")
lastval = table['lastval'].values.tolist()
newval = table['newval'].values.tolist()
rm = table['rm'].values.tolist()
itog = [0, 0, 0]
for i in range(3):
itog[i] = (newval[i]-lastval[i]) * rm[i]
pd.DataFrame(?????)
您正在尋找的功能是to_excel
。 在這里看看文檔。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.