Loading data from Excel on Mac reads Excel function rather than the cell value

27 views
Skip to first unread message

Gogo

unread,
Mar 15, 2021, 9:32:04 AM3/15/21
to Pyomo Forum
Hi everyone,

I have a problem with loading data from Excel using the DataPortal that comes with Pyomo. What happens is that when I load a parameter whose cell value is calculated in Excel using Excel functions, the function itself is loaded rather than the cell value. For example, if I am trying to load parameter A, and the cell I am loading it from contains the Excel function "=2*1", then the parameter A will get the string value of '=2*1' rather than the numerical value of 2.

I am using PyCharm (2020.3.3 Community Edition), Python 3.9.2 and have installed the openpyxl package (currently at version 3.0.7). This problem does not happen when I run the same code on a Windows machine, only on my Mac.

Does anyone have a fix for this, or is this a bug?

Note: This does not happen when I import the values through a Dataframe, but if possible I would like to avoid using hacky solutions and just import using the normal DataPortal.


Reply all
Reply to author
Forward
0 new messages