
python -- 读写文件
数据分析修炼手册
这个作者很懒,什么都没留下…
展开
-
python 读写txt、csv文件
python 读写文件2、读写 txt 文件(1)读取 txt 文件(2)写入 txt 文件3、读写csv文件(1)读取 csv 文件# read_csvdata = pd.read_csv(r'D:\学习\python\file\excel\data.csv')# csvimport csvwith open(r'D:\学习\python\file\excel\data.csv', 'r',encoding='utf-8') as f: data = df(csv.rea原创 2020-09-28 10:14:23 · 332 阅读 · 0 评论 -
python 读写excel文件(pandas/xlrd/xlwt/openpyxl)
python 读写excel文件(pandas/xlrd/xlwt/openpyxl)1、读取 excel 文件(1)read_excelimport pandas as pddata = pd.read_excel(r'D:\学习\python\file\excel\data.xlsx')(2)xlrdimport xlrdworkbook = xlrd.open_workbook(r'D:\学习\python\file\excel\data.xlsx') # 打开excel文件she原创 2020-09-27 17:24:54 · 809 阅读 · 0 评论