Skip to content

Commit d1ee3fb

Browse files
committed
Set zip strict=False in multiple plotting functions for backward compatibility
1 parent 9f5b60d commit d1ee3fb

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

pandas/plotting/_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ def _get_call_args(backend_name: str, data: Series | DataFrame, args, kwargs):
964964
keyword_args = ", ".join(
965965
[
966966
f"{name}={value!r}"
967-
for (name, _), value in zip(arg_def, args, strict=True)
967+
for (name, _), value in zip(arg_def, args, strict=False)
968968
]
969969
)
970970
msg = (

pandas/plotting/_matplotlib/boxplot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def _grouped_plot_by_column(
321321

322322
ax_values = []
323323

324-
for ax, col in zip(flatten_axes(axes), columns, strict=True):
324+
for ax, col in zip(flatten_axes(axes), columns, strict=False):
325325
gp_col = grouped[col]
326326
keys, values = zip(*gp_col, strict=True)
327327
re_plotf = plotf(keys, values, ax, xlabel=xlabel, ylabel=ylabel, **kwargs)
@@ -530,7 +530,7 @@ def boxplot_frame_groupby(
530530
layout=layout,
531531
)
532532
data = {}
533-
for (key, group), ax in zip(grouped, flatten_axes(axes), strict=True):
533+
for (key, group), ax in zip(grouped, flatten_axes(axes), strict=False):
534534
d = group.boxplot(
535535
ax=ax, column=column, fontsize=fontsize, rot=rot, grid=grid, **kwds
536536
)

pandas/plotting/_matplotlib/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ def _adorn_subplots(self, fig: Figure) -> None:
817817
f"number of columns = {self.nseries}"
818818
)
819819

820-
for ax, title in zip(self.axes, self.title, strict=True):
820+
for ax, title in zip(self.axes, self.title, strict=False):
821821
ax.set_title(title)
822822
else:
823823
fig.suptitle(self.title)

pandas/plotting/_matplotlib/hist.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ def _grouped_plot(
323323
naxes=naxes, figsize=figsize, sharex=sharex, sharey=sharey, ax=ax, layout=layout
324324
)
325325

326-
for ax, (key, group) in zip(flatten_axes(axes), grouped, strict=True):
326+
for ax, (key, group) in zip(flatten_axes(axes), grouped, strict=False):
327327
if numeric_only and isinstance(group, ABCDataFrame):
328328
group = group._get_numeric_data()
329329
plotf(group, ax, **kwargs)
@@ -557,7 +557,7 @@ def hist_frame(
557557
)
558558
can_set_label = "label" not in kwds
559559

560-
for ax, col in zip(flatten_axes(axes), data.columns, strict=True):
560+
for ax, col in zip(flatten_axes(axes), data.columns, strict=False):
561561
if legend and can_set_label:
562562
kwds["label"] = col
563563
ax.hist(data[col].dropna().values, bins=bins, **kwds)

pandas/plotting/_matplotlib/misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def f(t):
266266
color_values = get_standard_colors(
267267
num_colors=len(classes), colormap=colormap, color_type="random", color=color
268268
)
269-
colors = dict(zip(classes, color_values, strict=True))
269+
colors = dict(zip(classes, color_values, strict=False))
270270
if ax is None:
271271
ax = plt.gca()
272272
ax.set_xlim(-np.pi, np.pi)

0 commit comments

Comments
 (0)