Skip to content

Improve documentation for assert_frame|series_equal #26101 #26106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 22, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions pandas/util/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These belong as part of the description of check_less_precise

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

Expand Down Expand Up @@ -1154,6 +1160,12 @@ 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
--------
assert_series_equal : Equivalent method for asserting Series equality.
Expand Down