Skip to content

Commit

Permalink
Adding ValueError test for concat Series axis 'columns'
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonmburroughs committed Oct 11, 2016
1 parent a6694b9 commit cf3f998
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pandas/tests/frame/test_combine_concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,18 @@ def test_concat_axis_parameter(self):
concatted_columns = pd.concat([df1, df2], axis='columns')
assert_frame_equal(concatted_columns, expected_columns)

series1 = pd.Series([0.1, 0.2])
series2 = pd.Series([0.3, 0.4])

expected_row_series = pd.Series(
[0.1, 0.2, 0.3, 0.4], index=[0, 1, 0, 1])
concatted_row_series = pd.concat([series1, series2], axis='rows')
assert_series_equal(concatted_row_series, expected_row_series)

# A Series has no 'columns' axis
with assertRaisesRegexp(ValueError, 'No axis named columns'):
pd.concat([series1, series2], axis='columns')


class TestDataFrameCombineFirst(tm.TestCase, TestData):

Expand Down

0 comments on commit cf3f998

Please sign in to comment.