Exemplo n.º 1
0
def test_me_case_2():
    np_a = np.array([-2.1, -1, 4.3])
    ny_a = ny.array([-2.1, -1, 4.3])

    ans_np = np.corrcoef(np_a)
    ans_ny = ny.corrcoef(ny_a)

    assert_array_almost_equal(ans_np, ans_ny.get())
Exemplo n.º 2
0
def test_me_case_5():
    np_a = np.array([[1, 2, 1, 9, 10, 3, 2, 6, 7],
                     [2, 1, 8, 3, 7, 5, 10, 7, 2]])
    ny_a = ny.array([[1, 2, 1, 9, 10, 3, 2, 6, 7],
                     [2, 1, 8, 3, 7, 5, 10, 7, 2]])

    ans_np = np.corrcoef(np_a.T, rowvar=True)
    ans_ny = ny.corrcoef(ny_a.T, rowvar=True)

    assert_array_almost_equal(ans_np, ans_ny.get())
Exemplo n.º 3
0
def test_me_case_3():
    np_a = np.array([[1, 2, 1, 9, 10, 3, 2, 6, 7],
                     [2, 1, 8, 3, 7, 5, 10, 7, 2]])
    ny_a = ny.array([[1, 2, 1, 9, 10, 3, 2, 6, 7],
                     [2, 1, 8, 3, 7, 5, 10, 7, 2]])
    np_y = np.array([2, 1, 1, 8, 9, 4, 3, 5, 7])
    ny_y = ny.array([2, 1, 1, 8, 9, 4, 3, 5, 7])

    ans_np = np.corrcoef(np_a, np_y)
    ans_ny = ny.corrcoef(ny_a, ny_y)

    assert_array_almost_equal(ans_np, ans_ny.get())