pandas-excel operator

112 阅读1分钟
  • read Excel
with open("...","r") as file:
    line=file.readlines()
file.close()

pd.read_excel操作读取excel文件参数整理与实例

blog.csdn.net/brucewong05…

pandas 读取 — 写入excel 文件

blog.csdn.net/abcdrachel/…

CSV

import csv
with open("detail_list.csv","a",newline="",encoding="GBK")as listfile:
    writer=csv.writer(listfile,dialect="excel")
    head=["期次","本息","累计还款"]
    writer.writerow(head) #插入内容(表头)
    。。。。
    writer.writerow([c,Allmm,tm]) #写入值
f=open("。。。.txt","r")
content=f.read()
print(content)
f.close() #记得关闭表格