Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Absolute and relative references are converted to identical Python code. #159

Open
manns opened this issue Jan 27, 2024 · 0 comments
Open

Comments

@manns
Copy link

manns commented Jan 27, 2024

In order to create an xlsx importer for pyspread, I am trying to convert the formula =AVERAGE($C$1:$C$3) into Python code.

I am getting the code average(_R_("C1:C3")).

However, I would expect to get average(_R_("$C$1:$C$3")).

The problem is that both absolute and relative references are converted to identical Python code.
Therefore, I do not see how to implement differentiated relative and absolute reference behavior from imported Excel files in pyspread. (Note that for this reason, the functions _R_ and _C_ are re-implemented in pyspread.)

I am using the following code:

ex = excelformula.ExcelFormula(value)
code = ex.python_code

Environment

pycel 1.0b30
Python 3.11.6
Manjaro Linux (KDE)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant