zoukankan      html  css  js  c++  java
  • python xlrd对excel的读取功能

    工作簿

    • xlrd.open_workbook('test.xls')
      • workbook.dump()
      • workbook.nsheets
      • workbook.sheets()
      • workbook.sheet_names()
      • wookbook.sheet_by_index(0)
      • workbook.sheet_by_name(u'Sheet1')

    工作表

    • wookbook.sheet_by_index(0)
      • sheet.dump()
      • sheet.name
      • sheet.nrows
      • sheet.ncols
      • sheet.row(0)
      • sheet.col(0)
      • row_slice(0, start_colx=0, end_colx=None)
      • col_slice(0, start_rowx=0, end_rowx=None)
      • row_values(0, start_colx=0, end_colx=None)
      • col_values(0, start_rowx=0, end_rowx=None)

    单元格

    • sheet.cell(0, 0)
      • cell.dump()
      • cell.ctype
        • XL_CELL_EMPTY 0
        • XL_CELL_TEXT 1
        • XL_CELL_NUMBER 2
        • XL_CELL_DATE 3
        • XL_CELL_BOOLEAN 4
        • XL_CELL_ERROR 5
        • XL_CELL_BLANK 6
      • cell.value

    xlError单元格

    error_text_from_code = {
        0x00: '#NULL!',  # Intersection of two cell ranges is empty
        0x07: '#DIV/0!', # Division by zero
        0x0F: '#VALUE!', # Wrong type of operand
        0x17: '#REF!',   # Illegal or deleted cell reference
        0x1D: '#NAME?',  # Wrong function or range name
        0x24: '#NUM!',   # Value range overflow
        0x2A: '#N/A',    # Argument or function not available
    }
    

    Excel单元格命名

    • cellname(0, 0)
    • cellnameabs(0, 0)
    • colname(0)

    相关链接

  • 相关阅读:
    7. Reverse Integer
    2. Add Two Numbers
    1039. 顺序存储二叉树
    Codeforces 535D
    Codeforces 385D
    URAL
    URAL
    Codeforces Round #428 (Div. 2)
    鹰蛋坚硬度实验
    Codeforces Round #392 (Div. 2)-D. Ability To Convert
  • 原文地址:https://www.cnblogs.com/xianwang/p/4909391.html
Copyright © 2011-2022 走看看