Ejemplo n.º 1
0
def test_mean_axis0():
    expected = [2, 4, 10. / 3, 1]
    for func in (sp.csr_matrix, sp.csc_matrix, sp.coo_matrix):
        means = mean(func(X, dtype=np.float64), axis=0)
    assert_array_almost_equal(means, expected)
Ejemplo n.º 2
0
def test_mean_axis0():
    expected = [2, 4, 10./3, 1]
    for func in (sp.csr_matrix, sp.csc_matrix, sp.coo_matrix):
        means = mean(func(X, dtype=np.float64), axis=0)
    assert_array_almost_equal(means, expected)
Ejemplo n.º 3
0
def test_mean_axis1():
    expected = [2, 3.5, 3.5, 2, 1]
    for func in (sp.csr_matrix, sp.csc_matrix, sp.coo_matrix):
        means = mean(func(X, dtype=np.float64))
        assert_array_almost_equal(means, expected)
Ejemplo n.º 4
0
def test_mean_axis1():
    expected = [2, 3.5, 3.5, 2, 1]
    for func in (sp.csr_matrix, sp.csc_matrix, sp.coo_matrix):
        means = mean(func(X, dtype=np.float64))
        assert_array_almost_equal(means, expected)