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/7058#issuecomment-1254870161,https://api.github.com/repos/pydata/xarray/issues/7058,1254870161,IC_kwDOAMm_X85Ky8yR,4160723,2022-09-22T11:05:40Z,2022-09-22T11:05:40Z,MEMBER,@adelezaini I'm moving this issue to discussion Q&A as to my understanding Xarray already supports the operation that you describe here. Please let me know if I misunderstood your problem.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1379365175
https://github.com/pydata/xarray/issues/7058#issuecomment-1252540520,https://api.github.com/repos/pydata/xarray/issues/7058,1252540520,IC_kwDOAMm_X85KqEBo,4160723,2022-09-20T15:38:02Z,2022-09-20T15:40:34Z,MEMBER,"Hi @adelezaini,
I'm a bit confused since you're trying to make a simple operation between two DataArrays and the example that you mention is about element-wise product of a DataArray with an unlabelled numpy array.
If you want to perform an element-wise operation like `*` between two DataArrays, xarray supports [automatic broadcasting by dimension name](https://docs.xarray.dev/en/stable/user-guide/computation.html#broadcasting-by-dimension-name), so all you need is to ensure that the two DataArrays share common dimension names and have the same number of elements along those dimensions (the latter is not strictly required if the DataArrays both have coordinates along those dimensions, in which case xarray also [automatically aligns](https://docs.xarray.dev/en/stable/user-guide/computation.html#automatic-alignment) the two DataArrays).
> I believe a very useful implementation would be adding xr.mult(*arrays, dim, *args) - or xr.prod or similar -,
There's already [DataArray.prod](https://docs.xarray.dev/en/stable/generated/xarray.DataArray.prod.html) but it serves a different purpose, i.e., compute the product of array elements over a given dimension and return a reduced DataArray (like `numpy.prod`).
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1379365175