diff options
author | Keewis <keewis@posteo.de> | 2020-02-05 14:39:56 +0100 |
---|---|---|
committer | Keewis <keewis@posteo.de> | 2020-02-05 14:39:56 +0100 |
commit | 056810bf0160cb370eb85f4eed0560791f5ad8a9 (patch) | |
tree | 1f92d610b0d9fa147c29416528bd137e4881b78c | |
parent | fc28668d3daa6bedfb5f79a7cfaa2f47c8db7c88 (diff) | |
download | pint-056810bf0160cb370eb85f4eed0560791f5ad8a9.tar.gz |
also allow nan as a special value
-rw-r--r-- | pint/numpy_func.py | 2 |
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") |