'Test that the __array_wrap__ method converts a reduction ufunc
output that has a different shape into an ndarray view.  Without this a
method call like c.mean() returns a Column array object with length=1.'

def test_array_wrap(self):

    c = table.Column(name='a', data=[1.0, 2.0, 3.0])
    assert np.allclose(c.mean(), 2.0)
    assert isinstance(c.mean(), (np.floating, float))
    assert np.allclose(c.sum(), 6.0)
    assert isinstance(c.sum(), (np.floating, float))
    assert isinstance(np.cos(c), table.Column)
    c = table.Column(name='a', data=[1, 2, 3])
    assert np.allclose(c.sum(), 6)
    assert isinstance(c.sum(), (np.integer, int))
    c = table.Column(name='a', data=[[1, 2, 3], [4, 5, 6]])
    assert (c.sum() == 21)
    assert isinstance(c.sum(), (np.integer, int))
    assert np.all((c.sum(axis=0) == [5, 7, 9]))
    assert (c.sum(axis=0).shape == (3,))
    assert isinstance(c.sum(axis=0), np.ndarray)
    c = table.MaskedColumn(name='a', data=[1.0, 2.0, 3.0], mask=[0, 0, 1])
    assert np.allclose(c.mean(), 1.5)
    assert isinstance(c.mean(), (np.floating, float))
    assert np.allclose(c.sum(), 3.0)
    assert isinstance(c.sum(), (np.floating, float))
