Skip to content

BUG: fix construction of Series from dict with nested lists #18626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
TST: invalid construction of Series() from list of len != len(index)
  • Loading branch information
toobaz committed Apr 2, 2018
commit c6aa2047406374e5a5b1036948a1e6efb85be1b0
5 changes: 5 additions & 0 deletions pandas/tests/series/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ def test_scalar_conversion(self):
assert int(Series([1.])) == 1
assert long(Series([1.])) == 1

@pytest.mark.parametrize('scalar', [1, 'abc', {2, 3}])
@pytest.mark.parametrize('index', [range(2), ['a', 'b']])
def test_invalid_1_dimensional(self, scalar, index):
pytest.raises(ValueError, Series, [scalar], index=index)

def test_constructor(self):
assert self.ts.index.is_all_dates

Expand Down