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/4450#issuecomment-697507489,https://api.github.com/repos/pydata/xarray/issues/4450,697507489,MDEyOklzc3VlQ29tbWVudDY5NzUwNzQ4OQ==,2448579,2020-09-23T15:06:23Z,2020-09-23T15:06:23Z,MEMBER,"Yes. Somewhat related: I'm always confused about whether `ds.groupby(..., keep_attrs=True).mean()` or `ds.groupby(...).mean(keep_attrs=True)` is correct. (similarly for rolling, coarsen etc.)","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,706568536 https://github.com/pydata/xarray/issues/4450#issuecomment-697325890,https://api.github.com/repos/pydata/xarray/issues/4450,697325890,MDEyOklzc3VlQ29tbWVudDY5NzMyNTg5MA==,10194086,2020-09-23T12:17:51Z,2020-09-23T12:17:51Z,MEMBER,"Implementing `keep_attrs` as a kwarg to `map` and ```python with xr.set_options(keep_attrs=True): test_map = ds.groupby('lat').map(np.mean) ``` not working for coordinate variables are two different issues, right?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,706568536 https://github.com/pydata/xarray/issues/4450#issuecomment-696907513,https://api.github.com/repos/pydata/xarray/issues/4450,696907513,MDEyOklzc3VlQ29tbWVudDY5NjkwNzUxMw==,2448579,2020-09-22T18:41:13Z,2020-09-22T18:42:37Z,MEMBER,"That code passes `keep_attrs` to np.mean so it won't work. we should add `keep_attrs` as a kwarg to `map` you'll have to do it like this ``` import numpy as np import xarray as xr ds = xr.tutorial.open_dataset(""air_temperature"") with xr.set_options(keep_attrs=True): test_map = ds.groupby('lat').map(np.mean) test_map.lat ``` but it doesn't work for the coordinate variables. We'll have to fix it. Right now, you'll have to propagate attrs manually","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,706568536