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/1765#issuecomment-603907867,https://api.github.com/repos/pydata/xarray/issues/1765,603907867,MDEyOklzc3VlQ29tbWVudDYwMzkwNzg2Nw==,2448579,2020-03-25T15:31:01Z,2020-03-25T15:31:01Z,MEMBER,Closing since upstream issues have been closed.,"{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,279909699 https://github.com/pydata/xarray/issues/1765#issuecomment-351588123,https://api.github.com/repos/pydata/xarray/issues/1765,351588123,MDEyOklzc3VlQ29tbWVudDM1MTU4ODEyMw==,1217238,2017-12-14T02:19:32Z,2017-12-14T02:19:32Z,MEMBER,"I looked into this a little more. The fix is to make a copy of `bins` inside `_func`: ```python def _func(data, bin_data, bins): """"""Group unlabeled array 'data' according to values in 'bin_data' using bins defined in 'bins' and sum all values"""""" bins = np.array(bins) labels = bins[1:] da_data = xr.DataArray(data, name='data') da_bin_data = xr.DataArray(bin_data, name='bin_data') binned = da_data.groupby_bins(da_bin_data, bins, labels=labels, include_lowest=True).sum() return binned ``` The problem is that broadcasting (inside `xarray.apply_ufunc`/`np.vectorize`) produces readonly arrays, but the pandas function doesn't handle it properly (https://github.com/pandas-dev/pandas/issues/18773). We could potentially add a work-around in pandas to fix this, but the ultimate source issue is https://github.com/cython/cython/issues/1605","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,279909699 https://github.com/pydata/xarray/issues/1765#issuecomment-350078447,https://api.github.com/repos/pydata/xarray/issues/1765,350078447,MDEyOklzc3VlQ29tbWVudDM1MDA3ODQ0Nw==,1217238,2017-12-07T20:02:08Z,2017-12-07T20:02:08Z,MEMBER,"You probably need to give bins an explicit `'dummy'` dimension for using in apply_ufunc. We should update `apply_ufunc` to error when given an unlabeled array as input for an argument that has core-dimensions defined.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,279909699