How to groupby_bins using another variable? #7717
-
Hello, I'm trying to make more efficient the computation of water mass transform using the following code on a dataset with 12x6560x6540 (time,y,x). The extract below creates a mask to then multiply the mask (Heaviside function) to a given field (salinity component of the buoyancy flux) and sum it over time.
According to me, it should be possible to do this same computation using groupby_bins with the code below:
However I don't manage to make it work and I get the following error:
Without the sum over the time axis, the code seems to work as expected, returning a groupby_bins object:
returns:
however if I check the dims by Is this currently supported in xarray? or is there a more efficient way to do this computation? or am I doing something wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
We'd need a simple example to debug. Going through |
Beta Was this translation helpful? Give feedback.
We'd need a simple example to debug. Going through
groupby_bins
right now will compute thatrho
array, so I don't think that's what you want. Use flox instead