摘要:
csv是Comma-Separated Values的缩写,是用文本文件形式储存的表格数据。我们用python处理.csv文件时,发现用pandas工具包比csv工具包要方便很多,下面介绍一下一些基本的操作,如读写(read, write)和切片(slice)。 写(write)操作: import 阅读全文
posted @ 2019-06-23 23:58
愚公一山
阅读(1867)
评论(0)
推荐(0)
摘要:
# -*- coding: utf-8 -*- #导入需要使用的包 import xlrd #读取Excel文件的包 import xlsxwriter #将文件写入Excel的包 #打开一个excel文件 def open_xls(file): f = xlrd.open_workbook(file) return f #获取excel中所有的sheet表 def ... 阅读全文
posted @ 2019-06-23 23:43
愚公一山
阅读(6175)
评论(0)
推荐(0)
摘要:
# -*- coding: utf-8 -*-import xlrddef open_excel(file = 'file.xls'):#打开要解析的Excel文件 try: data = xlrd.open_workbook(file) return data except Exception a 阅读全文
posted @ 2019-06-23 23:13
愚公一山
阅读(728)
评论(0)
推荐(0)

浙公网安备 33010602011771号