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

Commit1962d84

Browse files
committed
MNT: support old versions of numpy
Numpy 1.7 does not support `np.nanmin` and `np.nanmax` on maskedarrays (instead of returning a number it returns a MaskedIterator).
1 parent380453b commit1962d84

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎lib/matplotlib/image.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,10 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
372372
scaled_dtype=A.dtype
373373
else:
374374
scaled_dtype=np.float32
375-
a_min=np.nanmin(A)
376-
a_max=np.nanmax(A)
375+
# old versions of numpy do not work with `np.nammin`
376+
# and `np.nanmax` as inputs
377+
a_min=np.ma.min(A)
378+
a_max=np.ma.max(A)
377379
# scale the input data to [.1, .9]. The Agg
378380
# interpolators clip to [0, 1] internally, use a
379381
# smaller input scale to identify which of the

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp