1 / 47
文档名称:

《在Python中的EXCEL应用》Working with Excel files in Python.docx

格式:docx   大小:66KB   页数:47页
下载后只包含 1 个 DOCX 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

《在Python中的EXCEL应用》Working with Excel files in Python.docx

上传人:xxj16588 2017/12/28 文件大小:66 KB

下载得到文件列表

《在Python中的EXCEL应用》Working with Excel files in Python.docx

文档介绍

文档介绍:Working with Excel files in Python
Reading Excel Files
All the examples shown below can be found in the xlrd directory of the course material.
Opening Workbooks
Workbooks can be loaded either from a file, an object or from a string:
Navigating a Workbook
Here is a simple example of workbook navigation:
The next few sections will cover the navigation of workbooks in more detail.
. Simplistix Ltd 2009
from mmap import mmap,ACCESS_READ
from xlrd import open_workbook
print open_workbook('')
with open('','rb') as f:
print open_workbook(
file_contents=mmap((),0,access=ACCESS_READ)
)
aString = open('','rb').read()
print open_workbook(file_contents=aString)

from xlrd import open_workbook
wb = open_workbook('')
for s in ():
print 'Sheet:',
for row in range():
values = []
for col in range():
((row,col).value)
print ','.join(values)
print

Page 8
Introspecting a Book
The object returned by open_workbook contains all information to do with
the workbook and can be used to retrieve individual sheets within the workbook.
The nsheets attribute is an integer containing the number of sheets in the workbook.
This attribute, bination with the sheet_by_index method, is the mon
way of retrieving individual sheets.
The sheet_names method returns a list of unicodes containing the names of all sheets in
the workbook. Individual sheets can be retrieved using these names by way of the
sheet_by_name function.
The results of the sheets method can be iterated over to retrieve each of the sheets in the
workbook.
The following example demonstrates these methods and attributes:
objects have other attributes relating to the content of the workbook that are
only rarely useful:
• codepage
• countries
• user_name
If you think you may need to use these attributes, please see the xlrd documentation.
. Simplistix Ltd

最近更新

2023年一级造价师之建设工程造价管理押题练习.. 20页

2023年公司法考试多选范文 5页

2023年真题及答案广东省高等教育自学考试现代.. 6页

2023年项目管理大作业 12页

2023高中生物教研组工作总结(3篇) 9页

EPC项目总承包合同协议范本 18页

XXX18年3月课程考试《统计学》作业考核试题10.. 17页

《人力资源管理》形成性考核真题(全3套卷) 30页

《影视广告创作》课程教学大纲 5页

《程序设计(JSP)》课程教学大纲(本科) 7页

一年级语文下册第一次月考试卷含答案 5页

业务委托协议书范本5篇(正规) 13页

中医护理学教学大纲 18页

中考冲刺复习方法 8页

人教版八年级生物下册期中学情评估附答案 (2).. 24页

企业管理课程总结 11页

体育与健康课《立定跳远》教案-【经典教育教学.. 7页

信息化教学2022年十堰市信息化教学大赛答辩试.. 16页

免疫学试题及答案(绝对) 18页

公共关系学课程标准 8页

公司转让合同协议范本10篇 40页

其他生产经营单位-主要负责人安全生产考试题库.. 22页

冬季除雪应急预案5篇 13页

初中学习目标与计划范文(精选22篇) 34页

剑桥商务英语中级考试真题 18页

北京市西城区下学期初中八年级期末考试生物试.. 8页

医院PACS系统解决方案 13页

南京外国语学校初中英语七年级下册期末知识点.. 7页

反幂法求特征值例题 5页

听课记录范文10篇高质量版 26页