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/131#issuecomment-43359850,https://api.github.com/repos/pydata/xarray/issues/131,43359850,MDEyOklzc3VlQ29tbWVudDQzMzU5ODUw,2443309,2014-05-16T17:49:14Z,2014-05-16T17:49:14Z,MEMBER,"Both NCO and CDO keep all attributes, and as you mention, maintain a history attribute. Even for operations like ""variance"" where the units are no longer accurate. Maybe we're headed to a user specified option to keep the attributes around with the default being option 1. I can see this existing at any (but probably not all) of these levels: - module (`xray.maintain_attributes=True`) - class (keyword in `Dataset` or `DataArray` `__init__(self, ..., maintain_attributes=True`) - method (`ds.mean(dim='time', maintain_attributes=True`) This approach would put the onus on the user to specify they want to keep metadata around. My preference would be to apply this at the module level. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,33637243 https://github.com/pydata/xarray/issues/131#issuecomment-43351948,https://api.github.com/repos/pydata/xarray/issues/131,43351948,MDEyOklzc3VlQ29tbWVudDQzMzUxOTQ4,2443309,2014-05-16T16:32:44Z,2014-05-16T16:32:44Z,MEMBER,"A couple more thoughts. I agree that staying metatdata unaware is the best course of action. However, I think you can do that but still carry the dataset and variable attributes (in the same manor that [NCO](http://nco.sourceforge.net/) and [CDO](https://code.zmaw.de/projects/cdo/wiki/Cdo) do). You just want to be explicit in the documentation by saying that the attributes are from the original dataset and that xray is not attribute aware or a units system (except for the time variable I guess). ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,33637243 https://github.com/pydata/xarray/issues/131#issuecomment-43300537,https://api.github.com/repos/pydata/xarray/issues/131,43300537,MDEyOklzc3VlQ29tbWVudDQzMzAwNTM3,2443309,2014-05-16T06:15:03Z,2014-05-16T06:15:03Z,MEMBER,"I'm willing to take a crack at it but I'm guessing I'll be requesting some assistance along the way. Let me look into a bit and I'll report back with how I see it going together. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,33637243 https://github.com/pydata/xarray/issues/131#issuecomment-43291229,https://api.github.com/repos/pydata/xarray/issues/131,43291229,MDEyOklzc3VlQ29tbWVudDQzMjkxMjI5,2443309,2014-05-16T03:06:41Z,2014-05-16T03:07:16Z,MEMBER,"I'm not sure we need to worry about the string representation too much. The `pandas.Panel` has a limited string representation too - [example](http://pandas.pydata.org/pandas-docs/stable/dsintro.html#from-3d-ndarray-with-optional-axis-labels). Then again, I find the pandas pannels difficult to work with. Maybe adding a thorough `Dataset.describe() method` would suffice. To flush out some of the desired functionality a bit more: (I'm going to use `numpy.mean` as an example but any numpy reduction function could be applied) 1. `Dataset.mean()` returns a new `Dataset`, with all the variables and attributes from the original `Dataset` reduced along all dimensions. 2. `Dataset.mean(dim='some_dim_name')` returns a new `Dataset`, with all the variables and attributes from the original `Dataset` reduced along the `sum_dim_name` dimension. 3. `Dataset.mean(dim=['Y', 'X'])` returns a new `Dataset`, with all the variables from the original `Dataset` reduced along the `Y` and `X` dimensions. 4. What to do with the reduced dimensions/variables? Reduced variables (e.g. when the mean is taken along the `time` dimension) could be a) reduced in the same manner (e.g. leave the time variable in the `Dataset` and just take the mean of the `time` array), b) removed, thereby reducing the `Dataset`'s dimensions. I think the cleanest way would be to remove the reduced dimensions/variables (b). 5. Any implementation should play nice with the `Dataset.groupby` objects (#122). ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,33637243