zoukankan      html  css  js  c++  java
  • python xlrd简单读取excel

     1 import xlrd
     2 #打开文件
     3 book = xlrd.open_workbook ('Status.xlsx')
     4 #获取数据表
     5 table1 = book.sheets()[0]
     6 table2 = book.sheets()[1]
     7 #读取行数据和列数据
     8 col_0 = table1.col_values(0)
     9 row_0 = table1.row_values(0)
    10 #读取数据表长度和宽度
    11 row_len = table1.nrows
    12 col_len = table1.ncols
    13 
    14 print len(book.sheets())
    15 print (row_len, col_len)
  • 相关阅读:
    随机数
    质数
    猜数
    失败
    判断质数
    2019.7.21记录
    9*9乘法表
    小人
    奔跑的字母

  • 原文地址:https://www.cnblogs.com/matrix-r/p/8704947.html
Copyright © 2011-2022 走看看