[new]: `quantize_into_fixed_width_bins(value, min_value, max_value, nb_bins)`
unytics opened this issue · 1 comments
unytics commented
Check the idea has not already been suggested
- I could not find my idea in existing issues
Edit the title above with self-explanatory function name and argument names
- The function name and the argument names I entered in the title above seems self explanatory to me.
BigFunction Description as it would appear in the documentation
Quantize value
into a bin.
Examples of (arguments, expected output) as they would appear in the documentation
quantize_into_fixed_width_bins(-4, 0, 100, 10)
--> ]-∞, 0[
quantize_into_fixed_width_bins(5, 0, 100, 10)
--> [0, 10[
quantize_into_fixed_width_bins(97, 0, 100, 10)
--> [90, 100]
quantize_into_fixed_width_bins(123, 0, 100, 10)
--> [100, + ∞[
unytics commented
you can look here a similar implementation:
https://github.com/unytics/bigfunctions/blob/main/bigfunctions/explore_column.yaml#L70