def test_categorical_unary_ceil(): cat = pd.Categorical(['a', 'a', 'b', 'c', 'a'], categories=['a', 'b', 'c']) pdsr = pd.Series(cat) sr = Series(cat) with pytest.raises(AttributeError) as raises: pdsr.ceil() raises.match(r'''no attribute ['"]ceil['"]''') with pytest.raises(TypeError) as raises: sr.ceil() raises.match('Categorical cannot perform the operation: ceil')
def test_series_ceil(): arr = np.random.random(100) * 100 sr = Series(arr) np.testing.assert_equal(sr.ceil().to_array(), np.ceil(arr))