Skip to content

Commit fecee8f

Browse files
sandepp123WillAyd
authored andcommitted
Improve documentation for assert_frame|series_equal #26101 (#26106)
1 parent 947bd76 commit fecee8f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pandas/util/testing.py

+12
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,12 @@ def assert_series_equal(left, right, check_dtype=True,
990990
Specify comparison precision. Only used when check_exact is False.
991991
5 digits (False) or 3 digits (True) after decimal points are compared.
992992
If int, then specify the digits to compare.
993+
994+
When comparing two numbers, if the first number has magnitude less
995+
than 1e-5, we compare the two numbers directly and check whether
996+
they are equivalent within the specified precision. Otherwise, we
997+
compare the **ratio** of the second number to the first number and
998+
check whether it is equivalent to 1 within the specified precision.
993999
check_names : bool, default True
9941000
Whether to check the Series and Index names attribute.
9951001
check_exact : bool, default False
@@ -1131,6 +1137,12 @@ def assert_frame_equal(left, right, check_dtype=True,
11311137
Specify comparison precision. Only used when check_exact is False.
11321138
5 digits (False) or 3 digits (True) after decimal points are compared.
11331139
If int, then specify the digits to compare.
1140+
1141+
When comparing two numbers, if the first number has magnitude less
1142+
than 1e-5, we compare the two numbers directly and check whether
1143+
they are equivalent within the specified precision. Otherwise, we
1144+
compare the **ratio** of the second number to the first number and
1145+
check whether it is equivalent to 1 within the specified precision.
11341146
check_names : bool, default True
11351147
Whether to check that the `names` attribute for both the `index`
11361148
and `column` attributes of the DataFrame is identical, i.e.

0 commit comments

Comments
 (0)