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/3546#issuecomment-555537348,https://api.github.com/repos/pydata/xarray/issues/3546,555537348,MDEyOklzc3VlQ29tbWVudDU1NTUzNzM0OA==,6815844,2019-11-19T14:40:01Z,2019-11-19T14:40:01Z,MEMBER,"> This behaviour, however, seems to be slightly different from the .loc API of pandas.DataFrame which can take boolean arrays for selection. Is there a reason for the discrepancy?
Hi, @roxyboy
This is just because that multidimensional boolean indexing is not yet implemented in xarray (#1887).
The one-dimensional indexing would work with `.loc`,
```python
In [2]: da = xr.DataArray([0, 1, 2], dims=['x'])
In [3]: da.loc[da < 1]
Out[3]:
array([0])
Dimensions without coordinates: x
```
FYI, in xarray, probably `.sel` and `.isel` methods are more convenient than `.loc`, as we don't need to remember the dimension order.
For the above (my) example, I would write
```python
da.isel(x=da < 1)
```
instead of `da.loc[da < 1]`.","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,524940277