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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy