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)
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)
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)