I have an Xarray dataset with x and y coordinates and 3 variables agb, col and row. You can have an overview looking at this (don't care about other coords/vars)
My goal is to group agb values based on col and row values, as shown here
and then produce a mean for each group, and assign the value to the corresponding (col,row) index in another DataArray, e.g. ( following the example above )
I can't figure out how to do it. I tried using the .groupby() method, but it works on coordinates and not on pairs taken from other variables.
Any suggestion?
Thanks in advance


