Skip to content

Commit 3dbb137

Browse files
euri10jreback
authored andcommitted
Added log10 to the list of unary functions df.eval can handle (#24140)
1 parent 3bc2831 commit 3dbb137

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

doc/source/enhancingperf.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ These operations are supported by :func:`pandas.eval`:
469469
* Simple variable evaluation, e.g., ``pd.eval('df')`` (this is not very useful)
470470
* Math functions: `sin`, `cos`, `exp`, `log`, `expm1`, `log1p`,
471471
`sqrt`, `sinh`, `cosh`, `tanh`, `arcsin`, `arccos`, `arctan`, `arccosh`,
472-
`arcsinh`, `arctanh`, `abs` and `arctan2`.
472+
`arcsinh`, `arctanh`, `abs`, `arctan2` and `log10`.
473473

474474
This Python syntax is **not** allowed:
475475

doc/source/whatsnew/v0.24.0.rst

+1
Original file line numberDiff line numberDiff line change
@@ -1355,6 +1355,7 @@ Numeric
13551355
- :meth:`Series.agg` can now handle numpy NaN-aware methods like :func:`numpy.nansum` (:issue:`19629`)
13561356
- Bug in :meth:`Series.rank` and :meth:`DataFrame.rank` when ``pct=True`` and more than 2:sup:`24` rows are present resulted in percentages greater than 1.0 (:issue:`18271`)
13571357
- Calls such as :meth:`DataFrame.round` with a non-unique :meth:`CategoricalIndex` now return expected data. Previously, data would be improperly duplicated (:issue:`21809`).
1358+
- Added ``log10`` to the list of supported functions in :meth:`DataFrame.eval` (:issue:`24139`)
13581359

13591360
Strings
13601361
^^^^^^^

pandas/core/computation/ops.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
_unary_math_ops = ('sin', 'cos', 'exp', 'log', 'expm1', 'log1p',
2525
'sqrt', 'sinh', 'cosh', 'tanh', 'arcsin', 'arccos',
26-
'arctan', 'arccosh', 'arcsinh', 'arctanh', 'abs')
26+
'arctan', 'arccosh', 'arcsinh', 'arctanh', 'abs', 'log10')
2727
_binary_math_ops = ('arctan2',)
2828
_mathops = _unary_math_ops + _binary_math_ops
2929

0 commit comments

Comments
 (0)