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
fix(bar): percentage_by_bar_group fails when an x value repeats #598
What:bar.plot(..., data_label_format="percentage_by_bar_group") fails when an x value repeats: ValueError: zip() argument 2 is shorter than argument 1. It fails the same way with sort_order set, and when the repeated values are the index. Checked on main @ c5f4b2a.
A repeated x is valid input: pandas draws one bar per row, and the other label formats work. The docstring says this mode shows "each bar's share of its x-axis group".
Cause:bar.py:219 computes df.groupby(x_col)[value_col].sum().sum(axis=1), one total per x value. _generate_percentage_labels then zips that against every bar with strict=True. The fix needs one denominator per row, e.g. groupby(x_col)[value_col].transform("sum").sum(axis=1).
Activity