From a59cfc7006274cd12b80cd4bfebf7f43f5d0ff7f Mon Sep 17 00:00:00 2001 From: Joseph Hughes Date: Fri, 7 Aug 2026 10:34:19 -0500 Subject: [PATCH] fix(zonebudget_example): index the budget values by position volumetric_budget_bar_plot labels each bar by indexing the values with the position of the bar, but the values are passed in as a series indexed by zone name, so the label lookup raised a KeyError. Pandas used to fall back to positional indexing for a series that is not indexed by integers and no longer does. The values are now taken out of the series before they are indexed. --- .docs/Notebooks/zonebudget_example.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.docs/Notebooks/zonebudget_example.py b/.docs/Notebooks/zonebudget_example.py index 0dada66711..5ef183cd7f 100644 --- a/.docs/Notebooks/zonebudget_example.py +++ b/.docs/Notebooks/zonebudget_example.py @@ -267,6 +267,11 @@ def volumetric_budget_bar_plot(values_in, values_out, labels, **kwargs): else: ax = plt.gca() + # the values are indexed by position below, and a series passed in is + # indexed by zone name, so the values are taken out of the series + values_in = np.asarray(values_in) + values_out = np.asarray(values_out) + x_pos = np.arange(len(values_in)) rects_in = ax.bar(x_pos, values_in, align="center", alpha=0.5)