Skip to content

Merge pull request #1 from pandas-dev/master - #34498 improve the .equals() docstring #35555

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

Closed
wants to merge 5 commits into from
Closed
Changes from all 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
14 changes: 5 additions & 9 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1199,11 +1199,9 @@ def equals(self, other):
"""
Test whether two objects contain the same elements.

This function allows two Series or DataFrames to be compared against
each other to see if they have the same shape and elements. NaNs in
the same location are considered equal. The column headers do not
need to have the same type, but the elements within the columns must
be the same dtype.
This function compares two Series or DataFrames.
checks if both have the same shape and elements.
columns must be the same dtype.

Parameters
----------
Expand Down Expand Up @@ -1234,10 +1232,8 @@ def equals(self, other):

Notes
-----
This function requires that the elements have the same dtype as their
respective elements in the other Series or DataFrame. However, the
column labels do not need to have the same type, as long as they are
still considered equal.
Header or index values may be of a different dtype.
NaN values at same positions are considered equal.

Examples
--------
Expand Down