Skip to content
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

how should xarray handle pandas attrs #3497

Open
dcherian opened this issue Nov 8, 2019 · 1 comment
Open

how should xarray handle pandas attrs #3497

dcherian opened this issue Nov 8, 2019 · 1 comment

Comments

@dcherian
Copy link
Contributor

dcherian commented Nov 8, 2019

Continuing discussion form #3491.

Pandas has added attrs to their objects. We should decide on what to do with them in the DataArray constructor. Many tests fail if we don't handle this case explicitly.

@dcherian:

Not sure what we want to do about these attributes in the long term. One option would be to pop the name attribute, assign to DataArray.name and keep the rest as DataArray.attrs? But what if name clashes with the provided name?

@max-sixty:

Agree! I think we could prioritize the supplied name above that in attrs. Another option would be raising an error if both were supplied.

@snowman2
Copy link
Contributor

Not sure what we want to do about these attributes in the long term.

I like the idea of using them the same way xarray does for metadata. The next step would be to get pandas to add .encoding and then they could do mask_and_scale on their read_* methods :).

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

No branches or pull requests

2 participants