diff --git a/lib/matplotlib/colors.py b/lib/matplotlib/colors.py index fdb4294b9696..32e282f6f563 100644 --- a/lib/matplotlib/colors.py +++ b/lib/matplotlib/colors.py @@ -98,7 +98,7 @@ def _sanitize_extrema(ex): if ex is None: return ex try: - ret = np.asscalar(ex) + ret = ex.item() except AttributeError: ret = float(ex) return ret diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py index 3ea0cb70d3e1..58a28c8f689a 100644 --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -421,9 +421,9 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0, A_scaled -= a_min # a_min and a_max might be ndarray subclasses so use - # asscalar to avoid errors - a_min = np.asscalar(a_min.astype(scaled_dtype)) - a_max = np.asscalar(a_max.astype(scaled_dtype)) + # item to avoid errors + a_min = a_min.astype(scaled_dtype).item() + a_max = a_max.astype(scaled_dtype).item() if a_min != a_max: A_scaled /= ((a_max - a_min) / 0.8) 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