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

ENH: Preserve attrs when converting to pandas dataframe #5327

Open
snowman2 opened this issue May 17, 2021 · 0 comments · May be fixed by #5335
Open

ENH: Preserve attrs when converting to pandas dataframe #5327

snowman2 opened this issue May 17, 2021 · 0 comments · May be fixed by #5335

Comments

@snowman2
Copy link
Contributor

Is your feature request related to a problem? Please describe.

import xarray

xds = xarray.DataArray([1], name="a", dims="a", attrs={"long_name": "Description about data"})
xds.attrs

Output:

{'long_name': 'Description about data'}
xds.to_dataframe().a.attrs

Output:

{}

Describe the solution you'd like
It would be nice if the attributes of the DataArray were preserved in each pandas.Series and the attributes of each Dataset were preserved on the pandas.Dataframe

Additional context

Things to be wary about is that it the pandas documentation says the attrs is experimental.

@snowman2 snowman2 linked a pull request May 18, 2021 that will close this issue
4 tasks
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 a pull request may close this issue.

1 participant