-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
[WIP] ENH: add to_xarray conversion method #11950
Conversation
cc @shoyer in preparation for deprecation of ndim > 2. |
73dbc03
to
2463456
Compare
coords = [ (a,self._get_axis(a)) for a in self._AXIS_ORDERS ] | ||
return xray.DataArray(self, | ||
coords=coords, | ||
).to_dataset() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this makes sense. I would simply return an xray.DataArray
here (no to_dataset
), since that is probably what users want if they are using panels, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, isn't by definition a DataArray
single dtype? yes Panel
are usually single dtypes, but can have multiple. I think also more consistent to always return a Dataset
, yes?
however in either case these don't look dtype segregated (e.g. compared to say the converted DataFrame), am I doing something wrong?
supersedes pandas-dev#11950 xref pandas-dev#10000 Author: Jeff Reback <jeff@reback.net> Closes pandas-dev#11972 from jreback/xarray and squashes the following commits: 85de0b7 [Jeff Reback] ENH: add to_xarray conversion method
xref #10000