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