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/987#issuecomment-242953090,https://api.github.com/repos/pydata/xarray/issues/987,242953090,MDEyOklzc3VlQ29tbWVudDI0Mjk1MzA5MA==,1063143,2016-08-28T02:58:24Z,2016-08-28T02:58:24Z,NONE,"@shoyer I think I saw `...` a long time ago and must have forgotten about it. Thank you so much for reminding me - I was really hoping for something like `...` for a while.
Btw, I must say not only that xarray is just so useful for many of my research, but also the devs' responses on the issues have been superb. Definitely one of the most pleasant experiences I have had with developers. Thank you.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,173494017
https://github.com/pydata/xarray/issues/987#issuecomment-242940333,https://api.github.com/repos/pydata/xarray/issues/987,242940333,MDEyOklzc3VlQ29tbWVudDI0Mjk0MDMzMw==,1063143,2016-08-27T20:55:59Z,2016-08-27T20:59:09Z,NONE,"Sure. My actual usage is usually much more complicated, but basically, with
``` python
import numpy as np
import xarray as xr
X = xr.DataArray(np.random.normal(size=(10, 10)),
coords=[range(10), range(10)],)
```
if I want to choose only values larger than 0 from X, it seems I cannot do `X[X > 0]`, I have to do `X.values[X.values > 0]`. You can see how this thing can quickly get long if I'm doing this for assignment with multidimensional xarrays - something like
``` python
X.loc[:, :, :, 'variable'].values[X.loc[:, :, :, 'variable'].values > 0] = Y.loc[:, :, :, 'variable'].values[Y.loc[:, :, :, 'variable'].values > 0]
```
Maybe I'm mistaken and there is a way to do this more nicely, but I haven't been able to figure it out.
Thank you!
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,173494017
https://github.com/pydata/xarray/issues/987#issuecomment-242937958,https://api.github.com/repos/pydata/xarray/issues/987,242937958,MDEyOklzc3VlQ29tbWVudDI0MjkzNzk1OA==,1063143,2016-08-27T20:06:12Z,2016-08-27T20:06:12Z,NONE,"Thanks a lot for the discussions. I agree it is very important to be consistent and explicit. Another thing was that sometimes `.values` makes a line of code really long - especially when I want to index a `DataArray` with another `DataArray` with some conditions, as I often have to use `.values` for each of them.
Currently I do not have a good idea about how to improve this - I will report back if one occurs to me. Thanks again!
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,173494017
https://github.com/pydata/xarray/issues/987#issuecomment-242796865,https://api.github.com/repos/pydata/xarray/issues/987,242796865,MDEyOklzc3VlQ29tbWVudDI0Mjc5Njg2NQ==,1063143,2016-08-26T17:22:06Z,2016-08-26T17:22:06Z,NONE,"I see - thanks a lot for the quick response. I knew there was a good reason for this.
I wonder if it is reasonable to return a scalar when there is neither `coords` nor `attrs` associated with the return value, or it would be too much ad-hoc thing. For example, in the original example the return value was ``, which does not have any useful information.
I think this might be reasonable because I only get into this issue when I'm doing an array-wide operation and I know I'm going to get an aggregate scalar and forget to use `.values`.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,173494017