Description
Code Sample, a copy-pastable example if possible
da = xr.DataArray([[[1]]], dims=["a","b","c"]).stack(ab=["a", "b"])
da.to_series()
# or
da.to_dataframe("A")
Problem description
When a dataarray has one multiindex dimension, as produced by stack, and has other dimesnions as well, to_series fails to create an combined multiindex.
I would expect a series/dataframe with a multiindex with names a,b,c. Instead I get
NotImplementedError: isna is not defined for MultiIndex
On the other hand, when there is only one dimension, which is stacked, to_series and to_dataframe work
da.isel(c=0).to_series()
Output of xr.show_versions()
xarray: 0.11.3
pandas: 0.23.4
numpy: 1.12.1
scipy: 0.19.1
netCDF4: 1.2.8
pydap: None
h5netcdf: None
h5py: 2.6.0
Nio: None
zarr: None
cftime: None
PseudonetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: 1.2.0
cyordereddict: None
dask: 0.17.3
distributed: 1.21.0
matplotlib: 2.2.2
cartopy: None
seaborn: 0.7.1
setuptools: 0.6
pip: 19.0.1
conda: None
pytest: 3.0.5
IPython: 5.8.0
sphinx: 1.5.1