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
{{ message }}
Repository navigation
categorical histogram: the unique bar re-counts singletons already shown as top values #1083
categorical_dict (histogram.py:78) sets unique_count = sum(val_counts == 1) over every value, including the top 7 that categorical_histogram already draws one by one. When fewer than 7 values repeat, the singletons in the top 7 are counted twice and the bars add up to more than 100%. Sixteen rows with counts 5, 3 and eight singletons draw a 31, b 19, five singletons at 6 each, and unique 50, 130% in total. A one-row column reads 1.5 100 and unique 100. Pandas and polars share the function. #365 reported unique at 100% on a polars bool column.
Probe script for this issue. Save it as probe_1083.py in a buckaroo checkout and run uv run python probe_1083.py. The output below is from main at e88ace9. Each case prints the histogram from pandas (pd), polars (pl) and xorq (xo): the bar kinds, the sum of the population bars, the sum of the categorical bars and the NA bar, then each bar as name:kind=value, and below that the histogram_bins range, min, max, nan_per and distinct_count.
Activity
paddymul commentedon Oct 7, 2026
Probe script for this issue. Save it as
probe_1083.pyin a buckaroo checkout and runuv run python probe_1083.py. The output below is from main at e88ace9. Each case prints the histogram from pandas (pd), polars (pl) and xorq (xo): the bar kinds, the sum of thepopulationbars, the sum of the categorical bars and the NA bar, then each bar asname:kind=value, and below that thehistogram_binsrange,min,max,nan_peranddistinct_count.probe_1083.py
Output at e88ace9