From 6216b9438954b2eaa2cb44dabccfc38e4d600d6f Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Thu, 18 Mar 2021 17:26:25 +0100 Subject: [PATCH 1/4] PERF: increase the minimum number of elements to use numexpr for ops from 1e4 to 1e5 --- pandas/core/computation/expressions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/computation/expressions.py b/pandas/core/computation/expressions.py index 0dbe5e8d83741..0e3fa09552975 100644 --- a/pandas/core/computation/expressions.py +++ b/pandas/core/computation/expressions.py @@ -40,7 +40,7 @@ } # the minimum prod shape that we will use numexpr -_MIN_ELEMENTS = 10000 +_MIN_ELEMENTS = 100000 def set_use_numexpr(v=True): From 2ffefc0e57754591ce3d643bbc933c32c0d98748 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Fri, 19 Mar 2021 10:51:53 +0100 Subject: [PATCH 2/4] to 1e6 --- pandas/core/computation/expressions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/computation/expressions.py b/pandas/core/computation/expressions.py index 0e3fa09552975..6f5d5ebc55478 100644 --- a/pandas/core/computation/expressions.py +++ b/pandas/core/computation/expressions.py @@ -40,7 +40,7 @@ } # the minimum prod shape that we will use numexpr -_MIN_ELEMENTS = 100000 +_MIN_ELEMENTS = 1000000 def set_use_numexpr(v=True): From 8d5976ebd329a9b3ca5e108b16aa2fe73dea8d3d Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Fri, 19 Mar 2021 10:55:32 +0100 Subject: [PATCH 3/4] update test --- pandas/tests/test_expressions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/test_expressions.py b/pandas/tests/test_expressions.py index 30f88ba5e76f6..96347ba5a733f 100644 --- a/pandas/tests/test_expressions.py +++ b/pandas/tests/test_expressions.py @@ -12,7 +12,7 @@ ) from pandas.core.computation import expressions as expr -_frame = DataFrame(np.random.randn(10000, 4), columns=list("ABCD"), dtype="float64") +_frame = DataFrame(np.random.randn(1000000, 4), columns=list("ABCD"), dtype="float64") _frame2 = DataFrame(np.random.randn(100, 4), columns=list("ABCD"), dtype="float64") _mixed = DataFrame( { From 4fe274f3720519593eff59a7e40ae4b3f53c7605 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Fri, 19 Mar 2021 13:48:31 +0100 Subject: [PATCH 4/4] Update pandas/core/computation/expressions.py Co-authored-by: Simon Hawkins --- pandas/core/computation/expressions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/computation/expressions.py b/pandas/core/computation/expressions.py index 6f5d5ebc55478..4f14ea73d5a88 100644 --- a/pandas/core/computation/expressions.py +++ b/pandas/core/computation/expressions.py @@ -40,7 +40,7 @@ } # the minimum prod shape that we will use numexpr -_MIN_ELEMENTS = 1000000 +_MIN_ELEMENTS = 1_000_000 def set_use_numexpr(v=True):