Skip to content

Commit 03946d4

Browse files
committed
Replaced use of zip with call to transpose
1 parent 14cd6cf commit 03946d4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/statistics/customized_violin_demo.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ def set_axis_style(ax, labels):
6262
pc.set_edgecolor('black')
6363
pc.set_alpha(1)
6464

65-
medians = np.percentile(data, 50, axis=1)
66-
inter_quartile_ranges = list(zip(*(np.percentile(data, [25, 75], axis=1))))
65+
tmp = (np.percentile(data, [25, 50, 75], axis=1)).T
66+
medians = tmp[:, 1]
67+
inter_quartile_ranges = tmp[:, [0, 2]]
6768
whiskers = [adjacent_values(sorted_array) for sorted_array in data]
6869

6970
# plot whiskers as thin lines, quartiles as fat lines,

0 commit comments

Comments
 (0)