You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calculating a cut using cuts.calculate_percentile_cut, it would be useful to have to the option to associate weight with the values argument.
This can be done through an extra argument weights to cuts.calculate_percentile_cut that defaults to equal weights for all values. Then the np.nanpercentile in cuts.calculate_percentile_cut would have to be replaced by a function that calculates weighted percentiles.
The text was updated successfully, but these errors were encountered:
I didn't consider weights inside bins important as of now, since we I'd expect the binning to be fine enough so that it doesn't matter, however if you have a usecase that requires taking the weights into account in bins, fine to add this here.
However, we'd of course need functions supporting weights for quantiles, which I didn't find in numpy or scipy with a quick search. So we might need to implement this ourselves using cumsum and searchsorted as proposed here:
When calculating a cut using
cuts.calculate_percentile_cut
, it would be useful to have to the option to associate weight with thevalues
argument.This can be done through an extra argument
weights
tocuts.calculate_percentile_cut
that defaults to equal weights for all values. Then thenp.nanpercentile
incuts.calculate_percentile_cut
would have to be replaced by a function that calculates weighted percentiles.The text was updated successfully, but these errors were encountered: