Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hello Andre, I have shared your frustration with finding out how to read data from an Excel file using excelpy.

The v34.3.1 documentation for excelpy lists the functions, but the alphabetical list goes directly from the "freezepanes" function to the "height" function. For some unknown reason, it does not list the "getcell" and "getrange" functions, which are what you want.

 |  get_cell(self, address, sheet=None)
 |      Get value from one cell.
 |  
 |  get_range(self, address, transpose=False, sheet=None)
 |      Get data from cells in the range.
 |      data = get_range(address, ...)
 |      Inputs:
 |      address   - range tuple specified as (topRow, leftCol, bottomRow, rightCol)
 |      transpose - Logical
 |          Excel methods read data row by row and returned as Python list of lists.
 |          transpose = False
 |              Each returned list represents data in a speadsheet row.
 |          transpose = True
 |              Each returned list represents data in a speadsheet column.
 |      Returns:
 |          data = List or List of Lists values.

You can see all of the documentation for the excelpy functions by writing the following two lines of Python code and running them in PSSE. import excelpy help(excelpy)

This should save you the hassle of installing additional module(s) to read Excel files. Hopefully PSSE will update their documentation so that more users are not confused as you and me were.

Hello Andre, I have shared your frustration with finding out how to read data from an Excel file using excelpy.

The v34.3.1 documentation for excelpy lists the functions, but the alphabetical list goes directly from the "freezepanes" function to the "height" function. For some unknown reason, it does not list the "getcell" and "getrange" functions, which are what you want.following two (very useful) functions.

 |  get_cell(self, address, sheet=None)
 |      Get value from one cell.
 |  
 |  get_range(self, address, transpose=False, sheet=None)
 |      Get data from cells in the range.
 |      data = get_range(address, ...)
 |      Inputs:
 |      address   - range tuple specified as (topRow, leftCol, bottomRow, rightCol)
 |      transpose - Logical
 |          Excel methods read data row by row and returned as Python list of lists.
 |          transpose = False
 |              Each returned list represents data in a speadsheet row.
 |          transpose = True
 |              Each returned list represents data in a speadsheet column.
 |      Returns:
 |          data = List or List of Lists values.

You can see all of the documentation for the excelpy functions by writing the following two lines of Python code importing excelpy and then running them in PSSE. import excelpy help(excelpy)help(excelpy).

This should save you the hassle of installing additional module(s) to read Excel files. Hopefully PSSE will update their documentation so that more users are not confused as you and me were.