diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2017-09-23 10:08:05 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-23 10:08:05 -0500 |
commit | b1ea23bbbf1b370d4993e222a539368aabec4e9c (patch) | |
tree | d6416320933d05529ce8b4b2e01d72a89a648cd9 /numpy/core/numeric.py | |
parent | 125572e94bcce94964708f1e64a7f9dbcfe77c7a (diff) | |
parent | 42fcdd0cc381a96d8096af7acda007317d08851f (diff) | |
download | numpy-b1ea23bbbf1b370d4993e222a539368aabec4e9c.tar.gz |
Merge pull request #9709 from spencerahill/spencerahill-allclose-docstring
DOC: allclose doesn't require matching shapes
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r-- | numpy/core/numeric.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index aa3a4076c..ce17a1900 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -2230,7 +2230,7 @@ def allclose(a, b, rtol=1.e-5, atol=1.e-8, equal_nan=False): See Also -------- - isclose, all, any + isclose, all, any, equal Notes ----- @@ -2240,9 +2240,14 @@ def allclose(a, b, rtol=1.e-5, atol=1.e-8, equal_nan=False): absolute(`a` - `b`) <= (`atol` + `rtol` * absolute(`b`)) The above equation is not symmetric in `a` and `b`, so that - `allclose(a, b)` might be different from `allclose(b, a)` in + ``allclose(a, b)`` might be different from ``allclose(b, a)`` in some rare cases. + The comparison of `a` and `b` uses standard broadcasting, which + means that `a` and `b` need not have the same shape in order for + ``allclose(a, b)`` to evaluate to True. The same is true for + `equal` but not `array_equal`. + Examples -------- >>> np.allclose([1e10,1e-7], [1.00001e10,1e-8]) |