summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeewis <keewis@posteo.de>2020-02-05 14:39:56 +0100
committerKeewis <keewis@posteo.de>2020-02-05 14:39:56 +0100
commit056810bf0160cb370eb85f4eed0560791f5ad8a9 (patch)
tree1f92d610b0d9fa147c29416528bd137e4881b78c
parentfc28668d3daa6bedfb5f79a7cfaa2f47c8db7c88 (diff)
downloadpint-056810bf0160cb370eb85f4eed0560791f5ad8a9.tar.gz
also allow nan as a special value
-rw-r--r--pint/numpy_func.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pint/numpy_func.py b/pint/numpy_func.py
index 1073643..10f4114 100644
--- a/pint/numpy_func.py
+++ b/pint/numpy_func.py
@@ -655,7 +655,7 @@ def _pad(array, pad_width, mode="constant", **kwargs):
if iterable(arg):
return tuple(_recursive_convert(a, unit=unit) for a in arg)
elif not _is_quantity(arg):
- if arg == 0:
+ if arg == 0 or np.isnan(arg):
arg = unit._REGISTRY.Quantity(arg, unit)
else:
arg = unit._REGISTRY.Quantity(arg, "dimensionless")