fasten histogram calculation in plot_conditional_quantiles
The local function segment_data()
from plot_conditional_quantiles()
is quite slow. The step to transform from xarray to pandas is fast but the bin calculation .apply(pd.cut, bins=bins, labels=bins[1:]).T.values
then is very slow. think about a better design. After more then 2 hours search, I couldn't find any build-in function in xarray. all the group functions work on the coordinate level and cannot be applied to the data itself.