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

Skip to content

Commit 5f7f6a8

Browse files
committed
Fix empty data statistics in boxplot_stats
Also, document `iqr` return value.
1 parent d86a505 commit 5f7f6a8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/cbook/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1158,6 +1158,7 @@ def boxplot_stats(X, whis=1.5, bootstrap=None, labels=None,
11581158
med 50th percentile
11591159
q1 first quartile (25th percentile)
11601160
q3 third quartile (75th percentile)
1161+
iqr interquartile range
11611162
cilo lower notch around the median
11621163
cihi upper notch around the median
11631164
whislo end of the lower whisker
@@ -1239,11 +1240,11 @@ def _compute_conf_interval(data, med, iqr, bootstrap):
12391240
stats['med'] = np.nan
12401241
stats['q1'] = np.nan
12411242
stats['q3'] = np.nan
1243+
stats['iqr'] = np.nan
12421244
stats['cilo'] = np.nan
12431245
stats['cihi'] = np.nan
12441246
stats['whislo'] = np.nan
12451247
stats['whishi'] = np.nan
1246-
stats['med'] = np.nan
12471248
continue
12481249

12491250
# up-convert to an array, just to be safe

0 commit comments

Comments
 (0)