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/6952#issuecomment-1225884104,https://api.github.com/repos/pydata/xarray/issues/6952,1225884104,IC_kwDOAMm_X85JEYHI,10194086,2022-08-24T15:30:37Z,2022-09-01T14:42:48Z,MEMBER,"Good point, that can be surprising. I think a warning could be added. ```python if not set(self.obj.dims) & set(self.weights.dims): warnings.warn("""") ``` However, I wonder if that would be too noisy, e.g. if there is a scalar on the Dataset: ```python xr.Dataset({""test_array"": test_array, ""scalar"": 1}).weighted(weights2).mean() ``` (could potentially skip scalars in the check). --- Edit: https://github.com/pydata/xarray/blob/790a444b11c244fd2d33e2d2484a590f8fc000ff/xarray/core/weighted.py#L192 may not be the right place, as it checks it on the Dataset level (and not on the DataArray level). ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1349572787