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

Skip to content

Commit 00deb04

Browse files
tacaswellQuLogic
authored andcommitted
MNT: avoid casting to numpy in violin_stats
1 parent 98f22a9 commit 00deb04

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/cbook/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,10 +1428,10 @@ def violin_stats(X, method, points=100, quantiles=None):
14281428
quantiles = _reshape_2D(quantiles, "quantiles")
14291429
# Else, mock quantiles if is none or empty
14301430
else:
1431-
quantiles = [[]] * np.shape(X)[0]
1431+
quantiles = [[]] * len(X)
14321432

14331433
# quantiles should has the same size as dataset
1434-
if np.shape(X)[:1] != np.shape(quantiles)[:1]:
1434+
if len(X) != len(quantiles):
14351435
raise ValueError("List of violinplot statistics and quantiles values"
14361436
" must have the same length")
14371437

0 commit comments

Comments
 (0)