From 4df78667e5b38560310f2e5e4e6b980821cce43d Mon Sep 17 00:00:00 2001 From: Spencer Hill Date: Mon, 18 Sep 2017 12:16:58 -0700 Subject: DOC allclose doesn't require matching shapes Closes https://github.com/numpy/numpy/issues/5654 --- numpy/core/numeric.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'numpy/core/numeric.py') diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index fde08490a..1f5d24936 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -2448,6 +2448,10 @@ def allclose(a, b, rtol=1.e-5, atol=1.e-8, equal_nan=False): The above equation is not symmetric in `a` and `b`, so that `allclose(a, b)` might be different from `allclose(b, a)` in some rare cases. + + The comparison of `a` and `b` includes 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 `np.equals`.) Examples -------- -- cgit v1.2.1 From 08d60af925bb31e08259301a11b47b7d6f390ef2 Mon Sep 17 00:00:00 2001 From: Spencer Hill Date: Mon, 18 Sep 2017 13:32:18 -0700 Subject: Add equals to See Also; remove 'np.' --- numpy/core/numeric.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'numpy/core/numeric.py') diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index 1f5d24936..4b78c16fd 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -2436,7 +2436,7 @@ def allclose(a, b, rtol=1.e-5, atol=1.e-8, equal_nan=False): See Also -------- - isclose, all, any + isclose, all, any, equals Notes ----- @@ -2451,7 +2451,7 @@ def allclose(a, b, rtol=1.e-5, atol=1.e-8, equal_nan=False): The comparison of `a` and `b` includes 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 `np.equals`.) + allclose(a, b) to evaluate to True. (The same is true for `equals`.) Examples -------- -- cgit v1.2.1 From 687d7b8675f8cbc216c822574eb5bcb92007b412 Mon Sep 17 00:00:00 2001 From: Spencer Hill Date: Tue, 19 Sep 2017 21:31:06 -0700 Subject: [ci skip] requested updates [ci skip] --- numpy/core/numeric.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'numpy/core/numeric.py') diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index 4b78c16fd..e30df8b4e 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -2436,7 +2436,7 @@ def allclose(a, b, rtol=1.e-5, atol=1.e-8, equal_nan=False): See Also -------- - isclose, all, any, equals + isclose, all, any, equal Notes ----- @@ -2446,12 +2446,13 @@ 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` includes 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 `equals`.) + + 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 -------- -- cgit v1.2.1 From 42fcdd0cc381a96d8096af7acda007317d08851f Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Sat, 23 Sep 2017 09:07:46 -0600 Subject: MAINT: Use single backticks when link needed. [ci skip] --- numpy/core/numeric.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numpy/core/numeric.py') diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index e30df8b4e..495bd7fad 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -2452,7 +2452,7 @@ def allclose(a, b, rtol=1.e-5, atol=1.e-8, equal_nan=False): 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``. + `equal` but not `array_equal`. Examples -------- -- cgit v1.2.1