issues: 510892578
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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 510892578 | MDU6SXNzdWU1MTA4OTI1Nzg= | 3433 | Attributes are dropped after `clip` even if `keep_attrs` is True | 167802 | closed | 0 | 5 | 2019-10-22T20:32:44Z | 2020-10-14T16:29:52Z | 2020-10-14T16:29:52Z | CONTRIBUTOR | MCVE Code Sample```python import xarray as xr import numpy as np arr = xr.DataArray(np.ones((5, 5)), attrs={'units': 'K'}) xr.set_options(keep_attrs=True) arr <xarray.DataArray (dim_0: 5, dim_1: 5)>array([[1., 1., 1., 1., 1.],[1., 1., 1., 1., 1.],[1., 1., 1., 1., 1.],[1., 1., 1., 1., 1.],[1., 1., 1., 1., 1.]])Dimensions without coordinates: dim_0, dim_1Attributes:units: Karr.clip(0, 1) <xarray.DataArray (dim_0: 5, dim_1: 5)>array([[1., 1., 1., 1., 1.],[1., 1., 1., 1., 1.],[1., 1., 1., 1., 1.],[1., 1., 1., 1., 1.],[1., 1., 1., 1., 1.]])Dimensions without coordinates: dim_0, dim_1``` Expected OutputI would expect the attributes to be kept Problem Description
Output of
|
{
"url": "https://api.github.com/repos/pydata/xarray/issues/3433/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} |
completed | 13221727 | issue |