def test_concat_mat(): s_data = np.arange(15).reshape(5, 3) t_data = np.arange(15, 30).reshape(5, 3) s = symbol("s", discover(s_data)) t = symbol("t", discover(t_data)) assert (compute(concat(s, t), {s: s_data, t: t_data}) == np.arange(30).reshape(10, 3)).all() assert (compute(concat(s, t, axis=1), {s: s_data, t: t_data}) == np.concatenate((s_data, t_data), axis=1)).all()
def test_concat_mat(): s_data = np.arange(15).reshape(5, 3) t_data = np.arange(15, 30).reshape(5, 3) s = symbol('s', discover(s_data)) t = symbol('t', discover(t_data)) assert (compute(concat(s, t), { s: s_data, t: t_data }) == np.arange(30).reshape(10, 3)).all() assert (compute(concat(s, t, axis=1), { s: s_data, t: t_data }) == np.concatenate((s_data, t_data), axis=1)).all()
def test_concat_arr(): s_data = np.arange(15) t_data = np.arange(15, 30) s = symbol("s", discover(s_data)) t = symbol("t", discover(t_data)) assert (compute(concat(s, t), {s: s_data, t: t_data}) == np.arange(30)).all()
def test_concat_arr(): s_data = Series(np.arange(15)) t_data = Series(np.arange(15, 30)) s = symbol('s', discover(s_data)) t = symbol('t', discover(t_data)) assert ( compute(concat(s, t), {s: s_data, t: t_data}) == Series(np.arange(30)) ).all()
def test_concat_mat(): s_data = DataFrame(np.arange(15).reshape(5, 3), columns=list('abc')) t_data = DataFrame(np.arange(15, 30).reshape(5, 3), columns=list('abc')) s = symbol('s', discover(s_data)) t = symbol('t', discover(t_data)) tm.assert_frame_equal( compute(concat(s, t), {s: s_data, t: t_data}), pd.DataFrame(np.arange(30).reshape(10, 3), columns=list('abc')), )