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/907#issuecomment-1259415318,https://api.github.com/repos/pydata/xarray/issues/907,1259415318,IC_kwDOAMm_X85LEScW,4160723,2022-09-27T12:11:35Z,2022-09-27T12:11:35Z,MEMBER,This is fixed in v2022.6.0. Xarray's `PandasMultiIndex` wrapper keeps track of the level coordinate dtypes. ,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,166441031 https://github.com/pydata/xarray/issues/907#issuecomment-459771318,https://api.github.com/repos/pydata/xarray/issues/907,459771318,MDEyOklzc3VlQ29tbWVudDQ1OTc3MTMxOA==,6213168,2019-02-01T16:00:24Z,2019-02-01T16:00:24Z,MEMBER,This issue is still valid as of xarray 0.11.0,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,166441031 https://github.com/pydata/xarray/issues/907#issuecomment-457898404,https://api.github.com/repos/pydata/xarray/issues/907,457898404,MDEyOklzc3VlQ29tbWVudDQ1Nzg5ODQwNA==,26384082,2019-01-27T08:15:03Z,2019-01-27T08:15:03Z,NONE,"In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity If this issue remains relevant, please comment here; otherwise it will be marked as closed automatically ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,166441031 https://github.com/pydata/xarray/issues/907#issuecomment-234686788,https://api.github.com/repos/pydata/xarray/issues/907,234686788,MDEyOklzc3VlQ29tbWVudDIzNDY4Njc4OA==,6213168,2016-07-23T00:24:38Z,2016-07-23T00:24:38Z,MEMBER,"Yes that works as well ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,166441031 https://github.com/pydata/xarray/issues/907#issuecomment-234685394,https://api.github.com/repos/pydata/xarray/issues/907,234685394,MDEyOklzc3VlQ29tbWVudDIzNDY4NTM5NA==,1217238,2016-07-23T00:09:21Z,2016-07-23T00:09:21Z,MEMBER,"Does `array.coords[dim] = array.coords[dim].values.astype(str)` work? In theory, I think it should... ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,166441031 https://github.com/pydata/xarray/issues/907#issuecomment-234685251,https://api.github.com/repos/pydata/xarray/issues/907,234685251,MDEyOklzc3VlQ29tbWVudDIzNDY4NTI1MQ==,6213168,2016-07-23T00:07:38Z,2016-07-23T00:07:38Z,MEMBER,"Crude workaround: ``` python # Convert object coords to string for dim in array.dims: if array.coords[dim].dtype == numpy.dtype('O'): array.coords[dim] = array.coords[dim].values.tolist() return array ``` The above works, but if you have more than a handful elements in the coord the performance hit will be severe. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,166441031 https://github.com/pydata/xarray/issues/907#issuecomment-234434065,https://api.github.com/repos/pydata/xarray/issues/907,234434065,MDEyOklzc3VlQ29tbWVudDIzNDQzNDA2NQ==,1217238,2016-07-22T01:50:06Z,2016-07-22T01:50:22Z,MEMBER,"This is a tricky one to fix. Stack is not the only operation that can convert string arrays to dtype=object -- reindex and align also do this. The challenge is that NumPy does not support variable width strings or strings with missing values. Hence, we end up with dtype=object arrays. In this particular case, we could preserve the string dtype by keeping track of the original dtype of the arrays at go into a MultiIndex as metadata, similar to how we currently use [`PandasIndexAdapter`](https://github.com/pydata/xarray/blob/884b247742af2480e269bb54c9102f08c867fdaa/xarray/core/indexing.py#L425) to preserve the original dtype on arrays converted into non-multi indexes. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,166441031