I was looking for a very easy and elegant way to multiply two DataArrays, that may have different dimensions, along a single axis.
My specific case: a first DataArray A has dimensions (lat, lon, natpft) and the second B (lat, natpft). My purpose is to have the product of A data in (lat, lon) multiplied by B values along lat for each natpft. If this operation could also include the nearest option in choosing which latitude to match, it would be great.
I have some ideas in mind but I guess there could be a single line code that can do this task. I also hope this could help someone else, since I couldn't find any question about this topic.