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/1041#issuecomment-568612475,https://api.github.com/repos/pydata/xarray/issues/1041,568612475,MDEyOklzc3VlQ29tbWVudDU2ODYxMjQ3NQ==,26384082,2019-12-24T00:22:28Z,2019-12-24T00:22:28Z,NONE,"In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity If this issue remains relevant, please comment here or remove the `stale` label; otherwise it will be marked as closed automatically ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,181534708 https://github.com/pydata/xarray/issues/1041#issuecomment-359613385,https://api.github.com/repos/pydata/xarray/issues/1041,359613385,MDEyOklzc3VlQ29tbWVudDM1OTYxMzM4NQ==,1892917,2018-01-22T23:45:56Z,2018-01-22T23:45:56Z,NONE,"@cwerner I have almost the same error here can you please suggest a solution? thanks https://stackoverflow.com/questions/48389030/pd-read-csv-fails-after-converting-the-timezone ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,181534708 https://github.com/pydata/xarray/issues/1041#issuecomment-343530337,https://api.github.com/repos/pydata/xarray/issues/1041,343530337,MDEyOklzc3VlQ29tbWVudDM0MzUzMDMzNw==,1217238,2017-11-10T17:07:17Z,2017-11-10T17:07:17Z,MEMBER,"@chrwerner Yes, exactly.","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,181534708 https://github.com/pydata/xarray/issues/1041#issuecomment-343527624,https://api.github.com/repos/pydata/xarray/issues/1041,343527624,MDEyOklzc3VlQ29tbWVudDM0MzUyNzYyNA==,13906519,2017-11-10T16:56:22Z,2017-11-10T16:56:22Z,NONE,"Ok, do you mean something like this? ``` ds = xr.open_dataset(fname_data, decode_times=False) ds['time_agg'] = xr.full_like(ds['time'], 0) ds['time_agg'][:] = np.repeat(np.arange(len(ds['time'])/10), 10) ds_agg = ds.groupby('time_agg').mean(dim='time') ``` ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,181534708 https://github.com/pydata/xarray/issues/1041#issuecomment-343525358,https://api.github.com/repos/pydata/xarray/issues/1041,343525358,MDEyOklzc3VlQ29tbWVudDM0MzUyNTM1OA==,1217238,2017-11-10T16:48:10Z,2017-11-10T16:48:10Z,MEMBER,"@chrwerner From an implementation perspective, resample works virtually identically to passing in an explicit array of values to `groupby()`. If you can make your arrays of ""10 year interval"" labels, you should be able to make this work.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,181534708 https://github.com/pydata/xarray/issues/1041#issuecomment-343524554,https://api.github.com/repos/pydata/xarray/issues/1041,343524554,MDEyOklzc3VlQ29tbWVudDM0MzUyNDU1NA==,13906519,2017-11-10T16:45:08Z,2017-11-10T16:45:08Z,NONE,"@shoyer Is it possible to resample using fixed user-defined intervals? I have a non-CF compliant time axis (years -22000 to 1989) and want to aggregate by mean or argmax for 10 year intervals... Is this possible using resample? ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,181534708 https://github.com/pydata/xarray/issues/1041#issuecomment-252307570,https://api.github.com/repos/pydata/xarray/issues/1041,252307570,MDEyOklzc3VlQ29tbWVudDI1MjMwNzU3MA==,1217238,2016-10-07T17:07:40Z,2016-10-07T17:07:40Z,MEMBER,"It seems like we should just make `resample()` work for non-dimension coordinates. I don't think there's any reason in principle why that shouldn't work. To make `sel()` efficient, we need to compute a hash table. So I think it's somewhat reasonable to require setting levels you want to select on to be part of a (multi)index. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,181534708 https://github.com/pydata/xarray/issues/1041#issuecomment-252294581,https://api.github.com/repos/pydata/xarray/issues/1041,252294581,MDEyOklzc3VlQ29tbWVudDI1MjI5NDU4MQ==,10050469,2016-10-07T16:13:00Z,2016-10-07T16:13:00Z,MEMBER,"Just an idea: what about adding a keyword to `resample()` (and maybe also to `sel()`)? Something like: ``` python ds.resample('D', by_coord='time') ``` ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,181534708 https://github.com/pydata/xarray/issues/1041#issuecomment-252293208,https://api.github.com/repos/pydata/xarray/issues/1041,252293208,MDEyOklzc3VlQ29tbWVudDI1MjI5MzIwOA==,10050469,2016-10-07T16:07:00Z,2016-10-07T16:07:41Z,MEMBER,"> but I feel like it searches for the coordinate with the same name as the supplied dimension. Probably searching for a coordinate containing only the dimension specified in resample could do the trick. Note that this is not limited to `.resample()` but also to `.sel()`. Indexing over a non-dimension coordinate is something I also needed to do (https://groups.google.com/forum/#!searchin/xarray/fabien%7Csort:relevance/xarray/KTlG2snZabg/5V1vs3ODBAAJ). But after looking into the implementation, I understand that it's quite complicated for xarray to keep track of all possible coordinates linked to one specific dimension. And what if there are more than one coordinate? ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,181534708 https://github.com/pydata/xarray/issues/1041#issuecomment-252193599,https://api.github.com/repos/pydata/xarray/issues/1041,252193599,MDEyOklzc3VlQ29tbWVudDI1MjE5MzU5OQ==,900941,2016-10-07T09:26:28Z,2016-10-07T09:26:59Z,CONTRIBUTOR,"Hi @shoyer: > Does a2.resample(""D"", ""time"") work in your second example? with `a2.resample(""D"", ""time"")` I get the following exception: ``` ValueError: 'time' not found in array dimensions ('t',) ``` > but I think this is working as intended -- if you only supply the name of a dimension with integer labels, xarray has no way to know how what times to use for resampling. I am not sure how it is done now or whether it is possible to implement, but I feel like it searches for the coordinate with the same name as the supplied dimension. Probably searching for a coordinate containing only the dimension specified in resample could do the trick. Maybe there is a better way to do what I am trying to do?: I needed it to calculate daily means. But I have a hole in my data in the middle of the year and resample is masking this hole, by adding masked fields. So I've done it with groupby as follows, but it seems there should be an easier way to achieve this: ``` python day_dates = [datetime(d.year, d.month, d.day) for d in pd.to_datetime(snfl.coords[""t""].values)] day_dates = DataArray(day_dates, name=""time"", dims=""t"") snfl = snfl.groupby(day_dates).mean(dim=""t"") ``` ","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,181534708 https://github.com/pydata/xarray/issues/1041#issuecomment-252150731,https://api.github.com/repos/pydata/xarray/issues/1041,252150731,MDEyOklzc3VlQ29tbWVudDI1MjE1MDczMQ==,1217238,2016-10-07T04:32:25Z,2016-10-07T04:32:25Z,MEMBER,"Does `a2.resample(""D"", ""time"")` work in your second example? I agree that the error message could be more helpful here, but I think this is working as intended -- if you only supply the name of a dimension with integer labels, xarray has no way to know how what times to use for resampling. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,181534708