issues: 365946491
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
365946491 | MDU6SXNzdWUzNjU5NDY0OTE= | 2457 | name of array disappear when apply "where" filter with Datarray but not with np.array | 5918182 | closed | 0 | 2 | 2018-10-02T15:12:30Z | 2019-02-11T17:35:02Z | 2019-02-11T17:35:02Z | NONE | I was trying to select by non dimensional coordinate, and I found that "where" works well, but it erase the name of my datarray only if filtering is done with another datarray as a non dimensional coordinate ``` import xarray as xr temp = 15 + 8 * np.random.randn(2, 2, 3) precip = 10 * np.random.rand(2, 2, 3) lon = [[-99.83, -99.32], [-99.79, -99.23]] lat = [[42.25, 42.21], [42.63, 42.59]] ds = xr.Dataset({'temperature': (['x', 'y', 'time'], temp)}, coords={'lon': (['x', 'y'], lon), 'lat': (['x', 'y'], lat), 'precipitation': (['x', 'y', 'time'], precip), 'time': pd.date_range('2014-09-06', periods=3), 'reference_time': pd.Timestamp('2014-09-05')}) ds["temperature"].where(ds.precipitation>5).sum(axis=2).plot()
Expected OutputI think that selecting with a datarray should not change the label of the data. Further I was expecting that as for "sel", "where" should change the title of the graph so that I know from the title that I performed a selection with where with a non dimensional coordinate |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/2457/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |