Difficult to convert pd.DataFrame
to Dataset
with multi-index
#8794
Labels
needs triage
Issue that has not been reviewed by xarray team member
What is your issue?
No direct way to create multi-index dataset
Unless I'm missing something, there is no easy way to convert a Pandas dataframe to a dataset with a multi-index. For example,
xr.Dataset.from_dataframe
automatically converts any Pandas multi-index into separate dimensions.Workaround is inefficient
One workaround is doing
xr.Dataset.from_dataframe(df).stack(...)
however this is very inefficient for sparse multi-indices.The text was updated successfully, but these errors were encountered: