Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite5c48d6

Browse files
committed
Change hist empty check to not use 2D arrays.
This causes a NumPy deprecation warning if the list is ragged.
1 parente842b17 commite5c48d6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎lib/matplotlib/axes/_axes.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6558,8 +6558,6 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
65586558
# Massage 'x' for processing.
65596559
x=cbook._reshape_2D(x,'x')
65606560
nx=len(x)# number of datasets
6561-
# basic input validation
6562-
input_empty=np.size(x)==0
65636561

65646562
# Process unit information
65656563
# Unit conversion is done individually on each dataset
@@ -6581,9 +6579,13 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
65816579
iflen(w)!=nx:
65826580
raiseValueError('weights should have the same shape as x')
65836581

6582+
input_empty=True
65846583
forxi,wiinzip(x,w):
6585-
ifwiisnotNoneandlen(wi)!=len(xi):
6584+
lxi=len(xi)
6585+
ifwiisnotNoneandlen(wi)!=lxi:
65866586
raiseValueError('weights should have the same shape as x')
6587+
iflxi:
6588+
input_empty=False
65876589

65886590
ifcolorisNone:
65896591
color= [self._get_lines.get_next_color()foriinrange(nx)]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp