From 5f46a28f918422b3199626becbaee561d22921c6 Mon Sep 17 00:00:00 2001 From: euri10 Date: Fri, 7 Dec 2018 08:42:27 +0100 Subject: [PATCH 1/5] Added log10 to the list of unary functions df.eval can handle --- pandas/core/computation/ops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/computation/ops.py b/pandas/core/computation/ops.py index 9e9f124352229..cbdb3525d5e88 100644 --- a/pandas/core/computation/ops.py +++ b/pandas/core/computation/ops.py @@ -23,7 +23,7 @@ _unary_math_ops = ('sin', 'cos', 'exp', 'log', 'expm1', 'log1p', 'sqrt', 'sinh', 'cosh', 'tanh', 'arcsin', 'arccos', - 'arctan', 'arccosh', 'arcsinh', 'arctanh', 'abs') + 'arctan', 'arccosh', 'arcsinh', 'arctanh', 'abs', 'log10') _binary_math_ops = ('arctan2',) _mathops = _unary_math_ops + _binary_math_ops From 8ecf4ceea7d802d4e4ec3b7ec8036051acdd27c1 Mon Sep 17 00:00:00 2001 From: euri10 Date: Fri, 7 Dec 2018 09:03:23 +0100 Subject: [PATCH 2/5] Added log10 to documentation --- doc/source/enhancingperf.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/enhancingperf.rst b/doc/source/enhancingperf.rst index 1c873d604cfe0..e40e078ccf075 100644 --- a/doc/source/enhancingperf.rst +++ b/doc/source/enhancingperf.rst @@ -482,7 +482,7 @@ These operations are supported by :func:`pandas.eval`: * Simple variable evaluation, e.g., ``pd.eval('df')`` (this is not very useful) * Math functions: `sin`, `cos`, `exp`, `log`, `expm1`, `log1p`, `sqrt`, `sinh`, `cosh`, `tanh`, `arcsin`, `arccos`, `arctan`, `arccosh`, - `arcsinh`, `arctanh`, `abs` and `arctan2`. + `arcsinh`, `arctanh`, `abs`, `arctan2` and `log10`. This Python syntax is **not** allowed: From 2ccaddb9726e4a57f1434770c532775c61ee1ea2 Mon Sep 17 00:00:00 2001 From: euri10 Date: Fri, 7 Dec 2018 15:21:37 +0100 Subject: [PATCH 3/5] Filled whatsnew for log10 addition --- doc/source/whatsnew/v0.23.5.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/source/whatsnew/v0.23.5.txt b/doc/source/whatsnew/v0.23.5.txt index 8f4b1a13c2e9d..7e2d2e342cd37 100644 --- a/doc/source/whatsnew/v0.23.5.txt +++ b/doc/source/whatsnew/v0.23.5.txt @@ -52,3 +52,7 @@ Bug Fixes **I/O** - Bug in :func:`read_csv` that caused it to raise ``OverflowError`` when trying to use 'inf' as ``na_value`` with integer index column (:issue:`17128`) + +**Numeric** + +- Added log10 to the list of supported functions in ``df.eval`` (:issue:`24139`) From 5c9b927fa2c858592e7474d753d8e8cd8e2af97a Mon Sep 17 00:00:00 2001 From: euri10 Date: Sun, 9 Dec 2018 16:51:56 +0100 Subject: [PATCH 4/5] Put whatsnew on the correct location --- doc/source/whatsnew/v0.23.5.txt | 6 +----- doc/source/whatsnew/v0.24.0.rst | 1 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/doc/source/whatsnew/v0.23.5.txt b/doc/source/whatsnew/v0.23.5.txt index 7e2d2e342cd37..0d2d65205b277 100644 --- a/doc/source/whatsnew/v0.23.5.txt +++ b/doc/source/whatsnew/v0.23.5.txt @@ -51,8 +51,4 @@ Bug Fixes **I/O** -- Bug in :func:`read_csv` that caused it to raise ``OverflowError`` when trying to use 'inf' as ``na_value`` with integer index column (:issue:`17128`) - -**Numeric** - -- Added log10 to the list of supported functions in ``df.eval`` (:issue:`24139`) +- Bug in :func:`read_csv` that caused it to raise ``OverflowError`` when trying to use 'inf' as ``na_value`` with integer index column (:issue:`17128`) \ No newline at end of file diff --git a/doc/source/whatsnew/v0.24.0.rst b/doc/source/whatsnew/v0.24.0.rst index 4e12b22c8ccac..c7e2e5df66bf8 100644 --- a/doc/source/whatsnew/v0.24.0.rst +++ b/doc/source/whatsnew/v0.24.0.rst @@ -1375,6 +1375,7 @@ Numeric - :meth:`Series.agg` can now handle numpy NaN-aware methods like :func:`numpy.nansum` (:issue:`19629`) - 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`) - Calls such as :meth:`DataFrame.round` with a non-unique :meth:`CategoricalIndex` now return expected data. Previously, data would be improperly duplicated (:issue:`21809`). +- Added log10 to the list of supported functions in ``df.eval`` (:issue:`24139`) Strings ^^^^^^^ From 068b47424d6576c6726cfb9eb1ae5d6cfe5fceee Mon Sep 17 00:00:00 2001 From: euri10 Date: Sun, 9 Dec 2018 17:07:15 +0100 Subject: [PATCH 5/5] Checked v0.23.5.txt from master to leave it unchanged Used correct syntax for whatsnew, hopefully --- doc/source/whatsnew/v0.23.5.txt | 2 +- doc/source/whatsnew/v0.24.0.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/whatsnew/v0.23.5.txt b/doc/source/whatsnew/v0.23.5.txt index 0d2d65205b277..8f4b1a13c2e9d 100644 --- a/doc/source/whatsnew/v0.23.5.txt +++ b/doc/source/whatsnew/v0.23.5.txt @@ -51,4 +51,4 @@ Bug Fixes **I/O** -- Bug in :func:`read_csv` that caused it to raise ``OverflowError`` when trying to use 'inf' as ``na_value`` with integer index column (:issue:`17128`) \ No newline at end of file +- Bug in :func:`read_csv` that caused it to raise ``OverflowError`` when trying to use 'inf' as ``na_value`` with integer index column (:issue:`17128`) diff --git a/doc/source/whatsnew/v0.24.0.rst b/doc/source/whatsnew/v0.24.0.rst index c7e2e5df66bf8..3da5ee210bc1f 100644 --- a/doc/source/whatsnew/v0.24.0.rst +++ b/doc/source/whatsnew/v0.24.0.rst @@ -1375,7 +1375,7 @@ Numeric - :meth:`Series.agg` can now handle numpy NaN-aware methods like :func:`numpy.nansum` (:issue:`19629`) - 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`) - Calls such as :meth:`DataFrame.round` with a non-unique :meth:`CategoricalIndex` now return expected data. Previously, data would be improperly duplicated (:issue:`21809`). -- Added log10 to the list of supported functions in ``df.eval`` (:issue:`24139`) +- Added ``log10`` to the list of supported functions in :meth:`DataFrame.eval` (:issue:`24139`) Strings ^^^^^^^