From 3f08b074172760b0f51d0273662621ce451c0f11 Mon Sep 17 00:00:00 2001 From: "Brandon M. Burroughs" Date: Tue, 11 Oct 2016 21:14:58 -0400 Subject: [PATCH] Adding concat tests for axis 0, 1, and 'index' --- pandas/tests/frame/test_combine_concat.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pandas/tests/frame/test_combine_concat.py b/pandas/tests/frame/test_combine_concat.py index 41b3c6358a239..5432545d48f6e 100644 --- a/pandas/tests/frame/test_combine_concat.py +++ b/pandas/tests/frame/test_combine_concat.py @@ -356,11 +356,26 @@ def test_concat_axis_parameter(self): concatted_row = pd.concat([df1, df2], axis='rows') assert_frame_equal(concatted_row, expected_row) + expected_index = pd.DataFrame( + {'A': [0.1, 0.2, 0.3, 0.4]}, index=[0, 1, 0, 1]) + concatted_index = pd.concat([df1, df2], axis='index') + assert_frame_equal(concatted_index, expected_index) + + expected_0 = pd.DataFrame( + {'A': [0.1, 0.2, 0.3, 0.4]}, index=[0, 1, 0, 1]) + concatted_0 = pd.concat([df1, df2], axis=0) + assert_frame_equal(concatted_0, expected_0) + expected_columns = pd.DataFrame( [[0.1, 0.3], [0.2, 0.4]], index=[0, 1], columns=['A', 'A']) concatted_columns = pd.concat([df1, df2], axis='columns') assert_frame_equal(concatted_columns, expected_columns) + expected_1 = pd.DataFrame( + [[0.1, 0.3], [0.2, 0.4]], index=[0, 1], columns=['A', 'A']) + concatted_1 = pd.concat([df1, df2], axis=1) + assert_frame_equal(concatted_1, expected_1) + series1 = pd.Series([0.1, 0.2]) series2 = pd.Series([0.3, 0.4])