Skip to content

BUG: Fix Series constructor for Categorical with index #19714

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

Merged
merged 9 commits into from
Feb 27, 2018
Prev Previous commit
Next Next commit
Potential fix for failed tests
  • Loading branch information
cbertinato committed Feb 26, 2018
commit e5423b7476431f3adb65cbc8ee312895cea93c1f
3 changes: 1 addition & 2 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,7 @@ def __init__(self, data=None, index=None, dtype=None, name=None,
if not is_list_like(data):
data = [data]
index = com._default_index(len(data))
else:
if not is_scalar(data) and len(index) != len(data):
elif is_list_like(data) and len(index) != len(data):
raise ValueError('Length of passed values is {val}, '
'index implies {ind}'
.format(val=len(data), ind=len(index)))
Expand Down