Skip to content

BUG: Unsupported operations #55091

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

Closed
3 tasks done
RinnetenseiQ opened this issue Sep 11, 2023 · 4 comments · Fixed by #58334
Closed
3 tasks done

BUG: Unsupported operations #55091

RinnetenseiQ opened this issue Sep 11, 2023 · 4 comments · Fixed by #58334
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member

Comments

@RinnetenseiQ
Copy link

RinnetenseiQ commented Sep 11, 2023

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
import numpy as np

matrix = np.random.randint(1, 3, size=(100, 5))
c = ["a", "b", "c", "d", "e"]
df = pd.DataFrame(matrix, columns=c)
transformed_df = df.eval("b_atan = arctan(b)")
transformed_df = transformed_df.drop(["b"], axis=1)
restored_df = transformed_df.eval("b = tan(b_atan)")

Issue Description

While running the example, I have getting the following exception:

ValueError: "tan" is not a supported function

Why "tan" is not supported if "arctan" is supported?
Where I can check the list of all supported mathematical functions?

Expected Behavior

"tan" function will be supported

Installed Versions

INSTALLED VERSIONS

commit : ca60aab
python : 3.9.16.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.22621
machine : AMD64
processor : Intel64 Family 6 Model 183 Stepping 1, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : Russian_Ukraine.1251

pandas : 1.4.4
numpy : 1.23.5
pytz : 2023.3
dateutil : 2.8.2
setuptools : 67.8.0
pip : 23.1.2
Cython : None
pytest : 7.1.2
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : 1.0.3
psycopg2 : None
jinja2 : 3.1.2
IPython : 8.5.0
pandas_datareader: None
bs4 : 4.12.2
bottleneck : None
brotli : None
fastparquet : None
fsspec : None
gcsfs : None
markupsafe : 2.1.3
matplotlib : 3.5.3
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : 1.9.3
snappy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
zstandard : None

@RinnetenseiQ RinnetenseiQ added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 11, 2023
@paulreece
Copy link
Contributor

You can find a list of the supported functions here in the API reference.

I'm not sure this is a bug since it's simply noting a function that doesn't exist. Maybe you should change this to a feature request if you can't find what you're looking for in the API reference?

@RinnetenseiQ
Copy link
Author

RinnetenseiQ commented Sep 13, 2023

You can find a list of the supported functions here in the API reference.

I'm not sure this is a bug since it's simply noting a function that doesn't exist. Maybe you should change this to a feature request if you can't find what you're looking for in the API reference?

How API reference page related to list of commands that supported in pd.eval() expressions?
When I check pd.eval() docs, I see:
"The expression to evaluate. This string cannot contain any Python statements, only Python expressions."

But this links dont provide me the list of mathematical functions like "atan", "cos" that supported in pd.eval().
I would like to see something like that:

  1. Basic: *, /, +, -, **, ...
  2. Trigonometric: cos(), sin(), atan(), ...
  3. Etc functions notification

I have setup this discussion as issue because I think that if "atan" are supported, "tan" can`t be not supported function

@RinnetenseiQ
Copy link
Author

image I fond the list of supported ops already

@paulreece
Copy link
Contributor

How API reference page related to list of commands that supported in pd.eval() expressions?

The Docs do give you a list of the basic operations, which you omitted above:

"The following arithmetic operations are supported: +, -, *, /, **, %, // (python engine only) 
along with the following boolean operations: | (or), & (and), and ~ (not)"

However I do think it would be helpful to list out those other functions you found in the source code in the Docs.

I also again, think you should change the label to an Enhancement, not a Bug, since we would be adding functionality to Pandas.

So there are 2 Action items Here:

  • Add the other functions you found somewhere in the Docs
  • Add functionality for tan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants