Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0f2ebb6

Browse files
committed
Improve error message for boxplot_stats function, by printing dimensions.
1 parent f3877c5 commit 0f2ebb6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/matplotlib/cbook.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1265,7 +1265,8 @@ def _compute_conf_interval(data, med, iqr, bootstrap):
12651265
if labels is None:
12661266
labels = itertools.repeat(None)
12671267
elif len(labels) != ncols:
1268-
raise ValueError("Dimensions of labels and X must be compatible")
1268+
raise ValueError(f"The number of labels ({len(labels)}) must match the"
1269+
f" number of columns ({ncols}).")
12691270

12701271
input_whis = whis
12711272
for ii, (x, label) in enumerate(zip(X, labels)):

0 commit comments

Comments
 (0)