# xarray.Dataset.from_dataframe¶

classmethod Dataset.from_dataframe(dataframe)

Convert a pandas.DataFrame into an xarray.Dataset

Each column will be converted into an independent variable in the Dataset. If the dataframe’s index is a MultiIndex, it will be expanded into a tensor product of one-dimensional indices (filling in missing values with NaN). This method will produce a Dataset very similar to that on which the ‘to_dataframe’ method was called, except with possibly redundant dimensions (since all dataset variables will have the same dimensionality).