8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8f3e9e6 + a75771b commit 3d5585aCopy full SHA for 3d5585a
lib/matplotlib/cbook.py
@@ -1685,7 +1685,7 @@ def safe_first_element(obj):
1685
def _safe_first_finite(obj, *, skip_nonfinite=True):
1686
"""
1687
Return the first finite element in *obj* if one is available and skip_nonfinite is
1688
- True. Otherwise return the first element.
+ True. Otherwise, return the first element.
1689
1690
This is a method for internal use.
1691
@@ -1697,7 +1697,7 @@ def safe_isfinite(val):
1697
return False
1698
try:
1699
return math.isfinite(val)
1700
- except TypeError:
+ except (TypeError, ValueError):
1701
pass
1702
1703
return np.isfinite(val) if np.isscalar(val) else True
0 commit comments