Skip to content

Commit

Permalink
TST: test for pandas-dev#9232
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrockmendel committed Dec 16, 2019
1 parent afc8360 commit db4ae90
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pandas/tests/frame/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@


class TestDataFrameConstructors:
def test_series_with_name_not_matching_column(self):
# GH#9232
x = pd.Series(range(5), name=1)
y = pd.Series(range(5), name=0)

result = pd.DataFrame(x, columns=[0])
expected = pd.DataFrame([], columns=[0])
tm.assert_frame_equal(result, expected)

result = pd.DataFrame(y, columns=[1])
expected = pd.DataFrame([], columns=[1])
tm.assert_frame_equal(result, expected)

@pytest.mark.parametrize(
"constructor",
[
Expand Down

0 comments on commit db4ae90

Please sign in to comment.