From 500de06b0bee7df63700812dcca0155fce474032 Mon Sep 17 00:00:00 2001 From: Sandeep P Date: Tue, 16 Apr 2019 14:01:08 +0530 Subject: [PATCH 1/4] Issue #26101 --- pandas/util/testing.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pandas/util/testing.py b/pandas/util/testing.py index 9659cb33686d0..4e1657e31d171 100644 --- a/pandas/util/testing.py +++ b/pandas/util/testing.py @@ -1001,6 +1001,12 @@ def assert_series_equal(left, right, check_dtype=True, obj : str, default 'Series' Specify object name being compared, internally used to show appropriate assertion message. + + When comparing two numbers, if the first number has magnitude less + than 1e-5, we compare the two numbers directly and check whether + they are equivalent within the specified precision. Otherwise, we + compare the **ratio** of the second number to the first number and + check whether it is equivalent to 1 within the specified precision. """ __tracebackhide__ = True @@ -1153,7 +1159,13 @@ def assert_frame_equal(left, right, check_dtype=True, obj : str, default 'DataFrame' Specify object name being compared, internally used to show appropriate assertion message. - + + When comparing two numbers, if the first number has magnitude less + than 1e-5, we compare the two numbers directly and check whether + they are equivalent within the specified precision. Otherwise, we + compare the **ratio** of the second number to the first number and + check whether it is equivalent to 1 within the specified precision. + See Also -------- assert_series_equal : Equivalent method for asserting Series equality. From 6767ec10118d5651b15605a2bc55b266e9f97bd7 Mon Sep 17 00:00:00 2001 From: Sandeep P Date: Tue, 16 Apr 2019 16:12:50 +0530 Subject: [PATCH 2/4] #26101 removed whitespace --- pandas/util/testing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/util/testing.py b/pandas/util/testing.py index 4e1657e31d171..98f0da491374a 100644 --- a/pandas/util/testing.py +++ b/pandas/util/testing.py @@ -1159,13 +1159,13 @@ def assert_frame_equal(left, right, check_dtype=True, obj : str, default 'DataFrame' Specify object name being compared, internally used to show appropriate assertion message. - + When comparing two numbers, if the first number has magnitude less than 1e-5, we compare the two numbers directly and check whether they are equivalent within the specified precision. Otherwise, we compare the **ratio** of the second number to the first number and check whether it is equivalent to 1 within the specified precision. - + See Also -------- assert_series_equal : Equivalent method for asserting Series equality. From 029f4429c204c2cd5360fb4d8e8cee5e69a459b1 Mon Sep 17 00:00:00 2001 From: Sandeep P Date: Sun, 21 Apr 2019 18:26:05 +0530 Subject: [PATCH 3/4] #26101 - made changes under check_less_precise --- pandas/util/testing.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/pandas/util/testing.py b/pandas/util/testing.py index 98f0da491374a..81b1db0217f23 100644 --- a/pandas/util/testing.py +++ b/pandas/util/testing.py @@ -990,6 +990,12 @@ def assert_series_equal(left, right, check_dtype=True, Specify comparison precision. Only used when check_exact is False. 5 digits (False) or 3 digits (True) after decimal points are compared. If int, then specify the digits to compare. + + When comparing two numbers, if the first number has magnitude less + than 1e-5, we compare the two numbers directly and check whether + they are equivalent within the specified precision. Otherwise, we + compare the **ratio** of the second number to the first number and + check whether it is equivalent to 1 within the specified precision. check_names : bool, default True Whether to check the Series and Index names attribute. check_exact : bool, default False @@ -1001,12 +1007,6 @@ def assert_series_equal(left, right, check_dtype=True, obj : str, default 'Series' Specify object name being compared, internally used to show appropriate assertion message. - - When comparing two numbers, if the first number has magnitude less - than 1e-5, we compare the two numbers directly and check whether - they are equivalent within the specified precision. Otherwise, we - compare the **ratio** of the second number to the first number and - check whether it is equivalent to 1 within the specified precision. """ __tracebackhide__ = True @@ -1137,6 +1137,12 @@ def assert_frame_equal(left, right, check_dtype=True, Specify comparison precision. Only used when check_exact is False. 5 digits (False) or 3 digits (True) after decimal points are compared. If int, then specify the digits to compare. + + When comparing two numbers, if the first number has magnitude less + than 1e-5, we compare the two numbers directly and check whether + they are equivalent within the specified precision. Otherwise, we + compare the **ratio** of the second number to the first number and + check whether it is equivalent to 1 within the specified precision. check_names : bool, default True Whether to check that the `names` attribute for both the `index` and `column` attributes of the DataFrame is identical, i.e. @@ -1160,11 +1166,6 @@ def assert_frame_equal(left, right, check_dtype=True, Specify object name being compared, internally used to show appropriate assertion message. - When comparing two numbers, if the first number has magnitude less - than 1e-5, we compare the two numbers directly and check whether - they are equivalent within the specified precision. Otherwise, we - compare the **ratio** of the second number to the first number and - check whether it is equivalent to 1 within the specified precision. See Also -------- From d6208f4d1bf6f87cc88d971123b7a3d907aad8d3 Mon Sep 17 00:00:00 2001 From: Sandeep P Date: Sun, 21 Apr 2019 20:04:28 +0530 Subject: [PATCH 4/4] #26101 - removed Double line break --- pandas/util/testing.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pandas/util/testing.py b/pandas/util/testing.py index 81b1db0217f23..0278432117631 100644 --- a/pandas/util/testing.py +++ b/pandas/util/testing.py @@ -1166,7 +1166,6 @@ def assert_frame_equal(left, right, check_dtype=True, Specify object name being compared, internally used to show appropriate assertion message. - See Also -------- assert_series_equal : Equivalent method for asserting Series equality.