html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue
https://github.com/pydata/xarray/issues/3674#issuecomment-598718876,https://api.github.com/repos/pydata/xarray/issues/3674,598718876,MDEyOklzc3VlQ29tbWVudDU5ODcxODg3Ng==,31126826,2020-03-13T13:26:38Z,2020-03-13T13:26:38Z,CONTRIBUTOR,"Yes, I'll give it a try.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,547091670
https://github.com/pydata/xarray/issues/3674#issuecomment-597536240,https://api.github.com/repos/pydata/xarray/issues/3674,597536240,MDEyOklzc3VlQ29tbWVudDU5NzUzNjI0MA==,31126826,2020-03-11T09:44:48Z,2020-03-11T09:44:48Z,CONTRIBUTOR,"@fujiisoup Since you implemented `remove_unused_levels_categories`, do you have any clue how to fix this?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,547091670
https://github.com/pydata/xarray/issues/3674#issuecomment-583065626,https://api.github.com/repos/pydata/xarray/issues/3674,583065626,MDEyOklzc3VlQ29tbWVudDU4MzA2NTYyNg==,31126826,2020-02-06T19:17:49Z,2020-02-06T19:17:49Z,CONTRIBUTOR,"Actually, after updating to version 0.15 I've found another issue in the same context.
More precisely, when using a multi-index with a non-categorical repeated coordinate and a categorical coordinate:
```python
import pandas as pd
i1 = pd.Series([0, 0])
cat = pd.CategoricalDtype(categories=['foo', 'bar', 'baz'])
i2 = pd.Series(['foo', 'bar'], dtype=cat)
df = pd.DataFrame({'i1': i1, 'i2': i2, 'values': [1, 2]})
ds = df.set_index(['i1', 'i2']).to_xarray()
print(ds)
```
raises the following error
```
Traceback (most recent call last):
File ""/home/matthieu/test.py"", line 8, in
ds = df.set_index(['i1', 'i2']).to_xarray()
File ""/opt/anaconda3/lib/python3.7/site-packages/pandas/core/generic.py"", line 2867, in to_xarray
return xarray.Dataset.from_dataframe(self)
File ""/opt/anaconda3/lib/python3.7/site-packages/xarray/core/dataset.py"", line 4555, in from_dataframe
idx = remove_unused_levels_categories(dataframe.index)
File ""/opt/anaconda3/lib/python3.7/site-packages/xarray/core/indexes.py"", line 26, in remove_unused_levels_
categories
index = pd.MultiIndex.from_arrays(levels, names=index.names)
File ""/opt/anaconda3/lib/python3.7/site-packages/pandas/core/indexes/multi.py"", line 425, in from_arrays
raise ValueError(""all arrays must be same length"")
ValueError: all arrays must be same length
```
but works fine when `i2` is not categorical.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,547091670
https://github.com/pydata/xarray/issues/3674#issuecomment-579379370,https://api.github.com/repos/pydata/xarray/issues/3674,579379370,MDEyOklzc3VlQ29tbWVudDU3OTM3OTM3MA==,31126826,2020-01-28T18:04:32Z,2020-01-28T18:04:32Z,CONTRIBUTOR,"Thank you for your work on this! I haven't found any other issue at the moment, I guess we can close this issue.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,547091670