8000 Suppress some warnings in examples by jenshnielsen · Pull Request #3958 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Suppress some warnings in examples #3958

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 1, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Hexbin, Dont calculate mean of empty slice
Avoids numpy warnings with the same result. Similar to what is done above
  • Loading branch information
jenshnielsen committed Dec 29, 2014
commit 80bf9f6b6e78a200984d84f69057384bfce33ec7
6 changes: 5 additions & 1 deletion lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4065,7 +4065,11 @@ def coarse_bin(x, y, coarse):
ind = coarse.searchsorted(x).clip(0, len(coarse) - 1)
mus = np.zeros(len(coarse))
for i in range(len(coarse)):
mu = reduce_C_function(y[ind == i])
yi = y[ind == i]
if len(yi) > 0:
mu = reduce_C_function(yi)
else:
mu = np.nan
mus[i] = mu
return mus

Expand Down
0