From e6f7e7b20ebb1512d6debee5e8592b0b5351ac49 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Fri, 2 Apr 2021 00:28:08 +0200 Subject: [PATCH] PERF: numexpr doesn't support floordiv, so don't try (#40727) --- pandas/core/computation/expressions.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandas/core/computation/expressions.py b/pandas/core/computation/expressions.py index 8205534c9d48b..43b6a6fb64314 100644 --- a/pandas/core/computation/expressions.py +++ b/pandas/core/computation/expressions.py @@ -128,8 +128,9 @@ def _evaluate_numexpr(op, op_str, a, b): roperator.rsub: "-", operator.truediv: "/", roperator.rtruediv: "/", - operator.floordiv: "//", - roperator.rfloordiv: "//", + # floordiv not supported by numexpr 2.x + operator.floordiv: None, + roperator.rfloordiv: None, # we require Python semantics for mod of negative for backwards compatibility # see https://github.com/pydata/numexpr/issues/365 # so sticking with unaccelerated for now