Skip to content

df.eval: "log10" is not a supported function #24139

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
euri10 opened this issue Dec 7, 2018 · 1 comment
Closed

df.eval: "log10" is not a supported function #24139

euri10 opened this issue Dec 7, 2018 · 1 comment
Labels
Numeric Operations Arithmetic, Comparison, and Logical operations
Milestone

Comments

@euri10
Copy link
Contributor

euri10 commented Dec 7, 2018

Code Sample, a copy-pastable example if possible

import pandas as pd
import numpy as np
df = pd.DataFrame({'a': np.random.randn(10)})
a = df.a
expr_works = "log(a)/log(10)"
expr_notsupported = "log10(a)"
out_works = df.eval(expr_works)
out_notsupported = df.eval(expr_notsupported)

Problem description

As expected,

    "\"{0}\" is not a supported function".format(name))
ValueError: "log10" is not a supported function

I know we can substitute the log10(a) behaviour with log(a)/log(10) but the pull request fix I'll post is a one word addition and makes things way more readable when you have long expressions

Expected Output

Output of pd.show_versions()

[paste the output of ``pd.show_versions()`` here below this line] pd.show_versions() INSTALLED VERSIONS ------------------ commit: 5f46a28 python: 3.6.7.final.0 python-bits: 64 OS: Linux OS-release: 4.18.0-2-amd64 machine: x86_64 processor: byteorder: little LC_ALL: None LANG: en_GB.UTF-8 LOCALE: en_GB.UTF-8 pandas: 0.23.4 pytest: 4.0.1 pip: 10.0.1 setuptools: 39.1.0 Cython: 0.29.1 numpy: 1.15.4 scipy: 1.1.0 pyarrow: 0.11.1 xarray: 0.11.0 IPython: 7.2.0 sphinx: 1.8.2 patsy: 0.5.1 dateutil: 2.7.5 pytz: 2018.7 blosc: 1.6.2 bottleneck: 1.2.1 tables: 3.4.4 numexpr: 2.6.8 feather: None matplotlib: 3.0.2 openpyxl: 2.5.12 xlrd: 1.1.0 xlwt: 1.3.0 xlsxwriter: 1.1.2 lxml: 4.2.5 bs4: 4.6.3 html5lib: 1.0.1 sqlalchemy: 1.2.14 pymysql: None psycopg2: None jinja2: 2.10 s3fs: None fastparquet: 0.2.0 pandas_gbq: None pandas_datareader: None
@jreback jreback added the Numeric Operations Arithmetic, Comparison, and Logical operations label Dec 7, 2018
@jreback jreback added this to the 0.24.0 milestone Dec 9, 2018
@jreback
Copy link
Contributor

jreback commented Dec 9, 2018

closed by #24140

@jreback jreback closed this as completed Dec 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

No branches or pull requests

2 participants