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

BUG: wrong BACKTICK_QUOTED_STRING prefix in DataFrame.eval() #47699

Open
3 tasks done
CNFeffery opened this issue Jul 13, 2022 · 3 comments
Open
3 tasks done

BUG: wrong BACKTICK_QUOTED_STRING prefix in DataFrame.eval() #47699

CNFeffery opened this issue Jul 13, 2022 · 3 comments
Assignees
Labels
Bug expressions pd.eval, query

Comments

@CNFeffery
Copy link

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import pandas as pd

demo = pd.DataFrame({
    'a': range(3),
    'b': range(3)
})

demo.eval('`a-b`=a-b')

Issue Description

image

Expected Behavior

should be like this:
image

Installed Versions

INSTALLED VERSIONS

commit : f00ed8f
python : 3.8.13.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.22000
machine : AMD64
processor : Intel64 Family 6 Model 158 Stepping 10, GenuineIntel
byteorder : little
LC_ALL : None
LANG : zh_CN.UTF-8
LOCALE : Chinese (Simplified)_China.936

pandas : 1.3.0
numpy : 1.23.0
pytz : 2022.1
dateutil : 2.8.2
pip : 21.2.2
setuptools : 61.2.0
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.0.3
IPython : 8.3.0
pandas_datareader: None
bs4 : 4.11.1
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.5.2
numexpr : 2.8.3
odfpy : None
openpyxl : 3.0.10
pandas_gbq : None
pyarrow : None
pyxlsb : None
s3fs : None
scipy : 1.8.1
sqlalchemy : None
tables : None
tabulate : None
xarray : 2022.3.0
xlrd : None
xlwt : None
numba : None

@CNFeffery CNFeffery added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Jul 13, 2022
@TarunRKaushik
Copy link
Contributor

TarunRKaushik commented Aug 2, 2022

can I pick this up?

@CNFeffery
Copy link
Author

can I pick this up?

sure

@Sm1Ling
Copy link

Sm1Ling commented Aug 5, 2022

Faced this issue too
df.eval("`Column-Name-1`.rolling(10).mean()") causes exception pandas.core.computation.ops.UndefinedVariableError: name 'BACKTICK_QUOTED_STRING_Column_MINUS_Name_MINUS_1' is not defined

@jbrockmendel jbrockmendel added the expressions pd.eval, query label Nov 25, 2022
@rhshadrach rhshadrach removed the Needs Triage Issue that has not been reviewed by a pandas team member label Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug expressions pd.eval, query
Projects
None yet
Development

No branches or pull requests

5 participants