二、excel的数据读取pandas(20190609)


代码:

xlsx = xlrd.open_workbook('...xls', formatting_info=True)
print('num:\n', xlsx.nsheets)


output_workbook = xlwt.Workbook()
output_worksheet = output_workbook.add_sheet('ok_output')

for row_index in range(xlsx.sheet_by_name('完成情况').nrows):
for column_index in range(xlsx.sheet_by_name('完成情况').ncols):
output_worksheet.write(row_index, column_index,
xlsx.sheet_by_name('完成情况').cell_value(row_index, column_index))
output_workbook.save('完成情况_output.xls')

——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
posted @ 2019-06-09 10:05  nimakk  阅读(317)  评论(0)    收藏  举报