From 476a566f73080d67b9aa9d072caccbc8a1a3182d Mon Sep 17 00:00:00 2001 From: Jeff Reback Date: Thu, 1 Apr 2021 18:45:49 -0400 Subject: [PATCH] Revert "PERF: numexpr doesn't support floordiv, so don't try (#40727)" This reverts commit e6f7e7b20ebb1512d6debee5e8592b0b5351ac49. --- pandas/core/computation/expressions.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pandas/core/computation/expressions.py b/pandas/core/computation/expressions.py index 43b6a6fb64314..8205534c9d48b 100644 --- a/pandas/core/computation/expressions.py +++ b/pandas/core/computation/expressions.py @@ -128,9 +128,8 @@ def _evaluate_numexpr(op, op_str, a, b): roperator.rsub: "-", operator.truediv: "/", roperator.rtruediv: "/", - # floordiv not supported by numexpr 2.x - operator.floordiv: None, - roperator.rfloordiv: None, + operator.floordiv: "//", + roperator.rfloordiv: "//", # 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