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
Fluid library function to bin a set of “observations” into a set of (potentially non-uniform) bins.
As a test case, use the new function to compute the 5-95% interpercentile range from the sample we generate from the preprocessing step in explorable-viz/transparent-text#22. This will make up part of the pipeline for the examples, and is needed to provide a data source for the whisker plots on the bar chart bars, and also for computing the appropriate probabilities to use in text like “very likely”.
Python libraries to consider:
pandas.cut (supports custom bins)
pandas.qcut (quantile-based bins)
numpy.digitize (similar but doesn’t require bin labels)
Going forward let’s use Python-inspired names for library functions, to leverage #1139.
See also:
explorable-viz/transparent-text#26
The text was updated successfully, but these errors were encountered:
@JosephBond It looks like qcut does take an argument that allows you specify the target quantiles, so we could take a similar approach. E.g. something pandas.qcut(xs, q=[0, 0.05, 0.95, 1.0]) but without the named argument syntax. Renamed task again.
rolyp
changed the title
Bin data set using custom bin sizes
Quantile-based discretisation function with custom quantiles
Dec 16, 2024
rolyp
changed the title
Quantile-based discretisation function with custom quantiles
Quantile-based discretisation function
Dec 16, 2024
Fluid library function to bin a set of “observations” into a set of (potentially non-uniform) bins.
As a test case, use the new function to compute the 5-95% interpercentile range from the sample we generate from the preprocessing step in explorable-viz/transparent-text#22. This will make up part of the pipeline for the examples, and is needed to provide a data source for the whisker plots on the bar chart bars, and also for computing the appropriate probabilities to use in text like “very likely”.
Python libraries to consider:
pandas.cut
(supports custom bins)pandas.qcut
(quantile-based bins)numpy.digitize
(similar but doesn’t require bin labels)Going forward let’s use Python-inspired names for library functions, to leverage #1139.
See also:
The text was updated successfully, but these errors were encountered: