Skip to content

Coerce Series to dict in Dataset constructor #764

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 1 commit into from
Feb 17, 2016
Merged

Coerce Series to dict in Dataset constructor #764

merged 1 commit into from
Feb 17, 2016

Conversation

max-sixty
Copy link
Collaborator

Resolves #740


# Need to coerce Series to a dict as it doesn't implement __iter__ like a mapping
# GH470
vars = dict(vars) if isinstance(vars, pd.Series) else vars
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do the two-liner instead? It's an extra line but less text -- and is clearer IMO

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh... this is good enough.

shoyer added a commit that referenced this pull request Feb 17, 2016
Coerce Series to dict in Dataset constructor
@shoyer shoyer merged commit 03b0c2e into pydata:master Feb 17, 2016
@max-sixty
Copy link
Collaborator Author

Would have been happy to do the two line version - agree it's clearer
Cheers for merging though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants