home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 778221436

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
778221436 MDU6SXNzdWU3NzgyMjE0MzY= 4763 Keep attributes across operations 49512274 closed 0     1 2021-01-04T16:45:45Z 2021-01-04T16:52:15Z 2021-01-04T16:52:15Z NONE      

Hi,

I felt on this issue#2582 about the problem when arithmetic operation doesn't keep attribute in an DataArray.

Is this problem not merged yet ? I just installed a fresh conda env with python3.8 & xarray 0.16.2 and the problem still persist :

```python ds = xr.Dataset({"a": (("x",), np.array([1,2,3]))}) ds["a"].attrs["units"] = "m" ds.a

Out[1]: <xarray.DataArray 'a' (x: 3)> array([1, 2, 3]) Dimensions without coordinates: x Attributes: units: m ```

```python ds["b"] = ds.a * 2 ds.b

Out[2]: <xarray.DataArray 'b' (x: 3)> array([2, 4, 6]) Dimensions without coordinates: x ```

Output of <tt>xr.show_versions()</tt> INSTALLED VERSIONS ------------------ commit: None python: 3.8.5 (default, Sep 4 2020, 07:30:14) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 4.15.0-128-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: fr_FR.UTF-8 LOCALE: fr_FR.UTF-8 libhdf5: None libnetcdf: None xarray: 0.16.2 pandas: 1.1.5 numpy: 1.19.2 scipy: None netCDF4: None pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: None nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: None distributed: None matplotlib: None cartopy: None seaborn: None numbagg: None pint: None setuptools: 51.0.0.post20201207 pip: 20.3.3 conda: None pytest: None IPython: 7.19.0 sphinx: None
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/4763/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 1 row from issue in issue_comments
Powered by Datasette · Queries took 0.723ms · About: xarray-datasette