Skip to content

DOC: Docstring updated for DataFrame.equals #34508

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 7 commits into from
Aug 7, 2020
Merged
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
15 changes: 5 additions & 10 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1201,9 +1201,11 @@ def equals(self, other):

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.
the same location are considered equal.

Copy link
Member

Choose a reason for hiding this comment

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

you can leave the blank line here

The row/column index do not need to have the same type, as long
as the values are considered equal. Corresponding columns must be of
the same dtype.

Parameters
----------
Expand Down Expand Up @@ -1232,13 +1234,6 @@ def equals(self, other):
numpy.array_equal : Return True if two arrays have the same shape
and elements, False otherwise.

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.

Examples
--------
>>> df = pd.DataFrame({1: [10], 2: [20]})
Expand Down