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/1772#issuecomment-351594036,https://api.github.com/repos/pydata/xarray/issues/1772,351594036,MDEyOklzc3VlQ29tbWVudDM1MTU5NDAzNg==,6815844,2017-12-14T02:58:02Z,2017-12-14T02:58:02Z,MEMBER,"For the above example, I consider the following output,
```python
Dimensions: (nz_points: 11)
Dimensions without coordinates: nz_points
Data variables:
x (nz_points) int64 0 0 1 1 1 2 2 2 3 3 3
y (nz_points) int64 1 2 0 1 2 0 1 2 0 1 2
```
It would return a `xr.Dataset` each keys of which are the dimension names and their values are `xr.DataArray` of valid indices.
`da[da.nonzero()]` or `da.isel(**da.nonzero())` would return a 1d-DataArray with non-dimensional coordinates, `x` and `y`.
(`nz_points` is the default dimension, equivalent to `da.nonzero(dim='nz_points')`)
`nonzero` method for `Dataset` is not obvious, but the return of `xr.DataArray.nonzero` should be passed to `xr.Dataset.isel()`.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,280875330