Skip to content
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

DOC: Improve df.equals() docstring #56458

Merged
merged 3 commits into from
Dec 11, 2023
Merged

Conversation

linus-md
Copy link
Contributor

@linus-md linus-md commented Dec 11, 2023

@mroeschke mroeschke added the Docs label Dec 11, 2023
@mroeschke mroeschke added this to the 2.2 milestone Dec 11, 2023
@mroeschke mroeschke merged commit cf2710d into pandas-dev:main Dec 11, 2023
46 of 48 checks passed
@mroeschke
Copy link
Member

Thanks @linus-md

@linus-md linus-md deleted the df-equals-doc branch December 11, 2023 19:36
@linus-md
Copy link
Contributor Author

@mroeschke you speed at reviewing PRs is very impressive! Good job! 😄

@mroeschke
Copy link
Member

Keep the doc improvement coming @linus-md!

Comment on lines -1454 to +1455
as the values are considered equal. Corresponding columns must be of
the same dtype.
as the values are considered equal. Corresponding columns and
index must be of the same dtype.
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure this is a good clarification? Because now this second sentence is contradicting with the first sentence ("row/column index do not need to have the same dtype") ..

Copy link
Member

Choose a reason for hiding this comment

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

It also doesn't seem to be true that the index dtype has to be the same (as also shown in the examples section):

In [12]: s1 = pd.Series([1, 2, 3])

In [13]: s2 = pd.Series([1, 2, 3], index=pd.Index([0., 1., 2.]))

In [14]: s1.equals(s2)
Out[14]: True

In [15]: s1.index.dtype
Out[15]: dtype('int64')

In [16]: s2.index.dtype
Out[16]: dtype('float64')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC: Improve DataFrame.equals docstring comparing index & column with extension dtypes
3 participants