Skip to content

Commit 6850b3b

Browse files
committed
using self.unary_fns
removed unused imports
1 parent 5712300 commit 6850b3b

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

pandas/core/computation/ops.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
import pandas.core.common as com
1818
from pandas.core.computation.check import _NUMEXPR_VERSION
1919
from pandas.core.computation.common import _ensure_decoded, _result_type_many
20-
from pandas.core.computation.expressions import (_NUMEXPR_INSTALLED,
21-
_ne_version_under_2_6_9)
20+
from pandas.core.computation.expressions import _NUMEXPR_INSTALLED
2221
from pandas.core.computation.scope import _DEFAULT_GLOBALS
2322

2423
from pandas.io.formats.printing import pprint_thing, pprint_thing_encoded

pandas/tests/computation/test_eval.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1641,9 +1641,8 @@ def eval(self, *args, **kwargs):
16411641
def test_unary_functions(self):
16421642
df = DataFrame({'a': np.random.randn(10)})
16431643
a = df.a
1644-
unary_functions = [x for x in self.unary_fns
1645-
if x not in ('floor', 'ceil')]
1646-
for fn in unary_functions:
1644+
1645+
for fn in self.unary_fns:
16471646
expr = "{0}(a)".format(fn)
16481647
got = self.eval(expr)
16491648
with np.errstate(all='ignore'):
@@ -1657,16 +1656,6 @@ def test_floor_and_ceil_functions_raise_error(self, ne_lt_2_6_9):
16571656
expr = "{0}(100)".format(fn)
16581657
self.eval(expr)
16591658

1660-
def test_floor_and_ceil_functions_evaluate_expressions(self, ne_gt_2_6_9):
1661-
df = DataFrame({'a': np.random.randn(10)})
1662-
a = df.a
1663-
for fn in ('floor', 'ceil'):
1664-
expr = "{0}(a)".format(fn)
1665-
got = self.eval(expr)
1666-
with np.errstate(all='ignore'):
1667-
expect = getattr(np, fn)(a)
1668-
tm.assert_series_equal(got, expect, check_names=False)
1669-
16701659
def test_binary_functions(self):
16711660
df = DataFrame({'a': np.random.randn(10),
16721661
'b': np.random.randn(10)})

0 commit comments

Comments
 (0)