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/2459#issuecomment-652009055,https://api.github.com/repos/pydata/xarray/issues/2459,652009055,MDEyOklzc3VlQ29tbWVudDY1MjAwOTA1NQ==,1277781,2020-06-30T19:53:46Z,2020-06-30T19:53:46Z,CONTRIBUTOR,"> I've reimplemented `from_dataframe` to make use of in #4184, and it indeed makes things much, much faster! The original example in this thread is now 40x faster.
Very good news!
Thanks for implementing it!
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,365973662
https://github.com/pydata/xarray/issues/2459#issuecomment-592991059,https://api.github.com/repos/pydata/xarray/issues/2459,592991059,MDEyOklzc3VlQ29tbWVudDU5Mjk5MTA1OQ==,1277781,2020-02-29T20:27:20Z,2020-02-29T20:27:20Z,CONTRIBUTOR,"I know this is not a recent thread but I found no resolution, and we just ran in the same issue recently. In our case we had a pandas series of roughly 15 milliion entries, with a 3-level multi-index which had to be converted to an xarray.DataArray. The .to_xarray took almost 2 minutes. Unstack + to_array took it down to roughly 3 seconds, provided the last level of the multi index was unstacked.
However a much faster solution was through numpy array. The below code is based on the [idea of Igor Raush](https://stackoverflow.com/a/35049899)
(In this case df is a dataframe with a single column, or a series)
```
arr = np.full(df.index.levshape, np.nan)
arr[tuple(df.index.codes)] = df.values.flat
da = xr.DataArray(arr,dims=df.index.names,coords=dict(zip(df.index.names, df.index.levels)))
```
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,365973662