Skip to content

Commit

Permalink
Adding concat tests for axis 0, 1, and 'index'
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonmburroughs committed Oct 12, 2016
1 parent cf3f998 commit 3f08b07
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pandas/tests/frame/test_combine_concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down

0 comments on commit 3f08b07

Please sign in to comment.