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
histogram labels: bucket names repeat when the range is narrow next to its magnitude (years read 2K–2K) #1081
fmt_num (histogram.py:19) picks an SI suffix from the largest bound and, after scaling, caps the decimals at 2 (line 30). A column whose spread is small next to its magnitude gets bucket names that repeat: years from 1990 to 2020 read 1.99K–1.99K, 2K–2K (three buckets) and 2.01K–2.01K, integers from 1,000,000 to 1,000,099 read 1M–1M for all twelve bars, and epoch seconds read 1.7B–1.7B. The plain branch caps at 6 decimals (line 33), which is #620's 0–0 for small numbers. pandas, polars and xorq all label with fmt_num.
The suffix stops at T, so a value above 1e15 prints every digit: a 1e30 fill value labels its tail 99–1000000000000000000T, and 1e308 makes a 300-character label. Separately, a bound of -0.5 rounded to 0 decimals keeps its sign, so an int8 column has buckets named -25<>-0 and -0<>24.
Choose the decimals from the bucket width at the scale shown, so neighbouring edges differ. Skip the SI suffix when the width is small next to the magnitude (years would read 1990–1993). Switch to scientific notation past T.
Context
Found while probing histogram edge cases after #1069. Reproduces on main at e88ace9.
Probe script for this issue. Save it as probe_1081.py in a buckaroo checkout and run uv run python probe_1081.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_1081.pyin a buckaroo checkout and runuv run python probe_1081.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_1081.py
Output at e88ace9