用于优化的excel(xl)2python(py)结构检索器。将xl文件的i/o转换成python。
xl2p的Python项目详细描述
用于优化的excel(xl)2python(py)结构检索器。将xl文件的i/o转换成python。
说明
将xl结构转换为py,并使用任意优化算法
现在,使用面向对象的公式 当前项目使用xl com接口(win32com库)来: Ongoing development: A simple evolutionary algorithm that runs based off the abovementioned structure.dictobj[Workbook number as int][Worksheet number as int][Row as int][Column as int]
evals
as of this update).
功能
- Conversion Library
The following XL functions can be currently handled by xl2py. xl2py is capable of undertaking single-cells, arrays and array/matrix operations
- Standard operators: +, -, /, *, ^
- Logical operators: <, >, <=, >=, <>, =
- IF
- AVERAGE
- STDEV.P
- TRANSPOSE
- ABS
- MMULT
- IFERROR
- SUM
- COUNT
- SQRT
已在最新更新中处理
- No more
evals
-> formulas are object oriented (Calculation-, Formula- and Reference- and Numeric-Blocks)
- by-operand handling
- Over the latest update development, by-operand handling of formulas took place of RPN (reverse-polish notation). For additional details, viz. github repository
正在路上
- Object serialization
- CVS outputs
- A conceptual example with corresponding XL file. (reach me for further assistance)
指令
- Installation
pipinstallxl2py==version_no
- Example: I/O object creation
importxl2pyBuilder=xl2py.builder()# creates a xl2py builder object# place the path of your XL filepath=r'C:\\User\\DEFAULT\\WHATEVER\\...'# define your XL file password (if it exists)pwd='password'# opens up a XL COM interface and attach it to the Builder objectBuilder.connect_com(path,pwd)# declare your input cell/range referencesinputs=xl2py.xlref(<Workbookstrorint>, \ <Worksheetint>,<A1-orR1C1-typeXLreferences>)# inputs include other inputs to the xlref objectinputs+=xl2py.xlref(<strorint>,<int>,<str>)# output must be a single cell referenceoutput=xl2py.xlref(<strorint>,<int>,<str>)# Now you are all set. You shall translate the XL structure to python.Builder.set_structure(inputs,output)# If you want to change the input cell/range values...# vals must be of the shape of the inputs# and must be parsed as a list of lists or numpy arraysBuilder.set_input_values(vals)# grab the output (objective fun) value as numpy arrayoutput_val=Builder.get_output_value()# Grab the new output value
你可以找到我@gabriel s.gusm_o<;gusmaogabriels@gmail.com>;