@@ -1625,24 +1625,33 @@ def eval(self, *args, **kwargs):
1625
1625
def test_unary_functions (self ):
1626
1626
df = DataFrame ({'a' : np .random .randn (10 )})
1627
1627
a = df .a
1628
- for fn in self .unary_fns :
1628
+ unary_functions = [x for x in self .unary_fns
1629
+ if x not in ('floor' , 'ceil' )]
1630
+ for fn in unary_functions :
1629
1631
expr = "{0}(a)" .format (fn )
1632
+ got = self .eval (expr )
1630
1633
with np .errstate (all = 'ignore' ):
1631
- if hasattr (np , fn ):
1632
- got = self .eval (expr )
1633
- expect = getattr (np , fn )(a )
1634
- tm .assert_series_equal (got , expect , check_names = False )
1634
+ expect = getattr (np , fn )(a )
1635
+ tm .assert_series_equal (got , expect , check_names = False )
1636
+
1637
+ @tm .skip_if_ne_ge_2_6_9
1638
+ def test_floor_and_ceil_functions_in_ne_lt_2_6_9 (self ):
1639
+ for fn in ('floor' , 'ceil' ):
1640
+ msg = "\" {0}\" is not a supported function" .format (fn )
1641
+ with pytest .raises (ValueError , match = msg ):
1642
+ expr = "{0}(100)" .format (fn )
1643
+ self .eval (expr )
1635
1644
1636
- def test_all_unary_functions_not_supported_in_numpy_112 (self ):
1645
+ @tm .skip_if_ne_lt_2_6_9
1646
+ def test_floor_and_ceil_functions_in_ne_ge_2_6_9 (self ):
1637
1647
df = DataFrame ({'a' : np .random .randn (10 )})
1638
1648
a = df .a
1639
- for fn in self . unary_fns :
1649
+ for fn in ( 'floor' , 'ceil' ) :
1640
1650
expr = "{0}(a)" .format (fn )
1651
+ got = self .eval (expr )
1641
1652
with np .errstate (all = 'ignore' ):
1642
- if not hasattr (np , fn ):
1643
- msg = '"{0}" is not a supported function' .format (fn )
1644
- with pytest .raises (ValueError , match = msg ):
1645
- self .eval (expr )
1653
+ expect = getattr (np , fn )(a )
1654
+ tm .assert_series_equal (got , expect , check_names = False )
1646
1655
1647
1656
def test_binary_functions (self ):
1648
1657
df = DataFrame ({'a' : np .random .randn (10 ),
0 commit comments