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/2933#issuecomment-709313477,https://api.github.com/repos/pydata/xarray/issues/2933,709313477,MDEyOklzc3VlQ29tbWVudDcwOTMxMzQ3Nw==,3621629,2020-10-15T13:09:18Z,2020-10-15T13:09:18Z,CONTRIBUTOR,"You could do it by creating a flatten view of the underlying numpy array, building the multiindex manually and creating a new DataArray from the view and the multiindex.","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,438947247
https://github.com/pydata/xarray/pull/2991#issuecomment-500109150,https://api.github.com/repos/pydata/xarray/issues/2991,500109150,MDEyOklzc3VlQ29tbWVudDUwMDEwOTE1MA==,3621629,2019-06-08T09:10:38Z,2019-06-08T09:10:38Z,CONTRIBUTOR,@shoyer it should be all good now,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,448478648
https://github.com/pydata/xarray/pull/3001#issuecomment-499598244,https://api.github.com/repos/pydata/xarray/issues/3001,499598244,MDEyOklzc3VlQ29tbWVudDQ5OTU5ODI0NA==,3621629,2019-06-06T17:47:36Z,2019-06-06T17:47:36Z,CONTRIBUTOR,"@spencerkclark
Are you ok with keeping the len > 0 test and then just moving up the assert at the top of the constructor of CFTimeIndex so that we raise before allocating the memory with `result._data = np.array(data, dtype='O')`","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,452734140
https://github.com/pydata/xarray/issues/2834#issuecomment-499285779,https://api.github.com/repos/pydata/xarray/issues/2834,499285779,MDEyOklzc3VlQ29tbWVudDQ5OTI4NTc3OQ==,3621629,2019-06-05T22:56:00Z,2019-06-05T22:58:18Z,CONTRIBUTOR,"Hello @maxdow
I'm not sure I understand your issue correctly. If all you want is to keep only the points `time, lat, lon` for which `t` and/or `dd` is not NA you can simply use
```python
z = d.stack(index=d.dims).dropna('index', how='all')
Dimensions: (index: 346)
Coordinates:
* index (index) MultiIndex
- time (index) datetime64[ns] 2019-03-09 2019-03-09 ... 2019-03-09
- lat (index) float64 43.5 43.5 43.5 43.75 43.75 ... 45.0 45.0 45.5 45.5
- lon (index) float64 1.25 1.5 4.25 1.75 2.25 ... 1.75 2.0 4.0 1.5 2.0
Data variables:
t (index) float64 0.6184 0.2966 1.426 0.8666 ... 0.09348 1.271 1.353
dd (index) float64 2.075 1.174 0.906 0.6451 ... 0.3491 0.1789 0.8922
```
You still have access to the coordinates of the valid points through `z.time`, `z.lat` and `z.lon`:
```python
z.lat
array([43.5 , 43.5 , 43.5 , ..., 51.25, 51.25, 51.25])
Coordinates:
* index (index) MultiIndex
- time (index) datetime64[ns] 2019-03-09 2019-03-09 ... 2019-03-09
- lat (index) float64 43.5 43.5 43.5 43.75 43.75 ... 45.0 45.0 45.5 45.5
- lon (index) float64 1.25 1.5 4.25 1.75 2.25 ... 1.75 2.0 4.0 1.5 2.0
```
One can still unstack this and achieve the equivalent of multi-dimensional dropna. However in your example all the coordinates for `time` look equal (they shouldn't be) and this will prevent unstacking.
I hope this helps
","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,423632904
https://github.com/pydata/xarray/issues/2933#issuecomment-499248139,https://api.github.com/repos/pydata/xarray/issues/2933,499248139,MDEyOklzc3VlQ29tbWVudDQ5OTI0ODEzOQ==,3621629,2019-06-05T20:44:29Z,2019-06-05T20:44:29Z,CONTRIBUTOR,"Hello @ray306
stack/unstack in xarray is a bit different from pandas mechanics.
- From the `stack` docstring
```
Stack any number of existing dimensions into a single new dimension.
New dimensions will be added at the end, and the corresponding
coordinate variables will be combined into a MultiIndex.
```
Breaking it down, `da.stack({'index': ['variable']})` fails because it's trying to:
1. create a new multi-index with a single level inside (`variable`) [so far so good but probably not what you had in mind]
2. add a new dimension named 'index' with coordinates given by the newly created index. This part yields the error you saw since `da` already has an index named `index`.
To mesh the `variable` dimension into the `index` dimension, you first need to unstack it:
```python
da.unstack('index').stack(index=('first', 'second', 'variable'))
```
- From the `unstack` docstring
```
Unstack existing dimensions corresponding to MultiIndexes into
multiple new dimensions.
Parameters
----------
dim : str or sequence of str, optional
Dimension(s) over which to unstack. By default unstacks all
MultiIndexes.
```
Your `da` array only has two dimensions: `variable` and `index`. That's why you can't `da.unstack('first')`. `first` is a coordinate (along the dimension 'index') not a dimension.
You could use
```
da.unstack('index').stack(index=['second'])
```
but this is somehow the same thing as `da.unstack()` since a multi-index with a single level is totally equivalent to the level itself.
I hope this helps you enjoy xarray and use it more.","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,438947247
https://github.com/pydata/xarray/pull/2991#issuecomment-495999155,https://api.github.com/repos/pydata/xarray/issues/2991,495999155,MDEyOklzc3VlQ29tbWVudDQ5NTk5OTE1NQ==,3621629,2019-05-26T13:13:22Z,2019-05-26T13:13:22Z,CONTRIBUTOR,"@shoyer
The api reference does not generate doc for the accessor methods. It's also missing for `.dt`
Do you know how to do this ?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,448478648
https://github.com/pydata/xarray/pull/1734#issuecomment-357043145,https://api.github.com/repos/pydata/xarray/issues/1734,357043145,MDEyOklzc3VlQ29tbWVudDM1NzA0MzE0NQ==,3621629,2018-01-11T19:56:03Z,2018-01-11T19:56:03Z,CONTRIBUTOR,@jhamman Thank you,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,275813162
https://github.com/pydata/xarray/pull/1734#issuecomment-349142414,https://api.github.com/repos/pydata/xarray/issues/1734,349142414,MDEyOklzc3VlQ29tbWVudDM0OTE0MjQxNA==,3621629,2017-12-04T23:29:29Z,2017-12-04T23:29:29Z,CONTRIBUTOR,"@shoyer Thanks for the help for the writing, most of these are your own words ^^","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,275813162
https://github.com/pydata/xarray/pull/1733#issuecomment-349105759,https://api.github.com/repos/pydata/xarray/issues/1733,349105759,MDEyOklzc3VlQ29tbWVudDM0OTEwNTc1OQ==,3621629,2017-12-04T21:07:40Z,2017-12-04T21:07:40Z,CONTRIBUTOR,Should i move the implementation on Variable and use temp datasets like `quantile` does ?,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,275789502
https://github.com/pydata/xarray/pull/1733#issuecomment-349088887,https://api.github.com/repos/pydata/xarray/issues/1733,349088887,MDEyOklzc3VlQ29tbWVudDM0OTA4ODg4Nw==,3621629,2017-12-04T20:06:41Z,2017-12-04T20:06:41Z,CONTRIBUTOR,"@shoyer when the ranking dimension is missing from an array in the dataset, should we do nothing, or put 1s everywhere ? None of these looks appealing or natural.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,275789502
https://github.com/pydata/xarray/pull/1734#issuecomment-348288575,https://api.github.com/repos/pydata/xarray/issues/1734,348288575,MDEyOklzc3VlQ29tbWVudDM0ODI4ODU3NQ==,3621629,2017-11-30T19:06:48Z,2017-11-30T19:06:48Z,CONTRIBUTOR,@shoyer all good,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,275813162
https://github.com/pydata/xarray/pull/1733#issuecomment-346905769,https://api.github.com/repos/pydata/xarray/issues/1733,346905769,MDEyOklzc3VlQ29tbWVudDM0NjkwNTc2OQ==,3621629,2017-11-24T23:23:36Z,2017-11-24T23:23:36Z,CONTRIBUTOR,Dropped support for Dataset. I don't think there's much use for it anyway.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,275789502
https://github.com/pydata/xarray/pull/1733#issuecomment-346713298,https://api.github.com/repos/pydata/xarray/issues/1733,346713298,MDEyOklzc3VlQ29tbWVudDM0NjcxMzI5OA==,3621629,2017-11-24T00:41:29Z,2017-11-24T00:41:29Z,CONTRIBUTOR,"@shoyer Thanks for the comment and the tips! I'll make the changes asap, hopefully this week-end","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,275789502
https://github.com/pydata/xarray/issues/1726#issuecomment-346106494,https://api.github.com/repos/pydata/xarray/issues/1726,346106494,MDEyOklzc3VlQ29tbWVudDM0NjEwNjQ5NA==,3621629,2017-11-21T17:47:44Z,2017-11-21T19:41:46Z,CONTRIBUTOR,"I dug it a bit further. Contrary to what I said numpy is fine. If `x` is a DataArray
```python
np.array(x.mean())
# -> array(2.0)
np.array([x.mean()])
# -> array([2.0])
np.array(x)
# -> ok
```
`pandas` behavior is more surprising
```python
pd.Series(2)
# ok
pd.Series(x.mean())
# -> TypeError: len() of unsized object
pd.Series([x.mean()])
# -> dtype=object
# however for 1D x
pd.Series(x)
# dtype is fine
```
Something looks a bit odd to me. But it looks more like a pandas issue","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,274996832
https://github.com/pydata/xarray/pull/1734#issuecomment-346124454,https://api.github.com/repos/pydata/xarray/issues/1734,346124454,MDEyOklzc3VlQ29tbWVudDM0NjEyNDQ1NA==,3621629,2017-11-21T18:51:09Z,2017-11-21T18:51:09Z,CONTRIBUTOR,"@fmaussion
In a nutshell,
```python
x = xr.DataArray([1,2,3])
pd.Series({'mean': x.mean()})
```
does not work as expected. You'll want one of
```python
pd.Series({'mean': float(x.mean())})
pd.Series({'mean': x.mean()}, dtype=float)
pd.Series({'mean': x.mean()}).astype(float)
```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,275813162
https://github.com/pydata/xarray/issues/1731#issuecomment-346084931,https://api.github.com/repos/pydata/xarray/issues/1731,346084931,MDEyOklzc3VlQ29tbWVudDM0NjA4NDkzMQ==,3621629,2017-11-21T16:37:37Z,2017-11-21T16:38:32Z,CONTRIBUTOR,"A few points:
* `nanrankdata` only support numeric types, how about wrapping `rankdata` with a keyword option ?
* There's also a push `push` method similar to pandas `ffill` which would be nice.
* `move_rank` outputs are not normalized as `rankdata`, this might be a bit confusing","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,275461273
https://github.com/pydata/xarray/issues/1726#issuecomment-345790125,https://api.github.com/repos/pydata/xarray/issues/1726,345790125,MDEyOklzc3VlQ29tbWVudDM0NTc5MDEyNQ==,3621629,2017-11-20T18:47:12Z,2017-11-20T18:47:12Z,CONTRIBUTOR,"Thanks for your answer.
I'll try to find a good spot in the doc to write a line or two about this.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,274996832