Skip to content

Support pandas.Series in the Dataset constructor #740

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
shoyer opened this issue Feb 2, 2016 · 2 comments
Closed

Support pandas.Series in the Dataset constructor #740

shoyer opened this issue Feb 2, 2016 · 2 comments

Comments

@shoyer
Copy link
Member

shoyer commented Feb 2, 2016

Follow up on #677

cc @MaximilianR

@max-sixty
Copy link
Collaborator

I think this is why it doesn't currently work: http://stackoverflow.com/questions/35442924/how-does-pythons-dict-constructor-handle-mappings

Tangentially related to: pandas-dev/pandas#12056 - i.e. from the pandas side, should Series be Mappings?

We could add a separate path for Series in the dataset constructor, or even monkey patch ChainMap. Neither seems that elegant

@shoyer
Copy link
Member Author

shoyer commented Feb 16, 2016

I would be perfectly happy with adding something like this to the Dataset constructor:

if isinstance(data_vars, pd.Series):
    data_vars = dict(data_vars)

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

No branches or pull requests

2 participants