8000 Floor and ceil methods during pandas.eval which are provided by numexpr by anjsudh · Pull Request #24355 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

Floor and ceil methods during pandas.eval which are provided by numexpr #24355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Dec 30, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix imports
  • Loading branch information
anjsudh committed Dec 30, 2018
commit bb07d26b0937f208766e728186138e239aafde73
2 changes: 1 addition & 1 deletion pandas/core/computation/expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import numpy as np

import pandas.core.common as com
from pandas.core.computation.check import _NUMEXPR_INSTALLED
from pandas.core.computation.check import _NUMEXPR_INSTALLED, _NUMEXPR_VERSION
from pandas.core.config import get_option

if _NUMEXPR_INSTALLED:
Expand Down
3 changes: 1 addition & 2 deletions pandas/core/computation/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
import pandas as pd
from pandas.core.base import StringMixin
import pandas.core.common as com
from pandas.core.computation.check import _NUMEXPR_VERSION
from pandas.core.computation.check import _NUMEXPR_INSTALLED, _NUMEXPR_VERSION
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anjsudh ok, the problem is we can't import here (we have a check in code_checks to avoid importing the optional dependencies until they are needed).

So. I think just add floor & ceil to the _math_ops (always) and better to do a run-time check if this op exists in ne (not exactly sure how to do that).

from pandas.core.computation.common import _ensure_decoded, _result_type_many
from pandas.core.computation.expressions import _NUMEXPR_INSTALLED
from pandas.core.computation.scope import _DEFAULT_GLOBALS

from pandas.io.formats.printing import pprint_thing, pprint_thing_encoded
Expand Down
3 changes: 1 addition & 2 deletions pandas/tests/computation/test_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from pandas.core.computation.engines import _engines, NumExprClobberingError
from pandas.core.computation.expr import PythonExprVisitor, PandasExprVisitor
from pandas.core.computation.expressions import (
_USE_NUMEXPR, _NUMEXPR_INSTALLED)
_USE_NUMEXPR, _NUMEXPR_INSTALLED, _NUMEXPR_VERSION)
from pandas.core.computation.ops import (
_binary_ops_dict,
_special_case_arith_ops_syms,
Expand All @@ -32,7 +32,6 @@
assert_numpy_array_equal, assert_series_equal,
assert_produces_warning)
from pandas.compat import PY3, reduce
from pandas.core.computation.check import _NUMEXPR_VERSION


_series_frame_incompatible = _bool_ops_syms
Expand Down
0