-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Clarify equals method docstring #19213
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
Conversation
Make explicit that equals method requires that columns have the same dtypes but not that indices have the same types (e.g. `pd.DataFrame({1:[0], 0:[1]}).equals(pd.DataFrame({1.0:[0], 0.0:[1]}))` returns `True` while `pd.DataFrame({1:[0], 0:[1]}, dtype='float32').equals(pd.DataFrame({1:[0], 0:[1]}, dtype='float64'))` returns `False`)
Codecov Report
@@ Coverage Diff @@
## master #19213 +/- ##
==========================================
+ Coverage 91.53% 91.55% +0.02%
==========================================
Files 147 147
Lines 48797 48797
==========================================
+ Hits 44664 44675 +11
+ Misses 4133 4122 -11
Continue to review full report at Codecov.
|
Sorry, I meant "column labels" rather than "indices." |
We check the indices for equality. But we happen to have this case.
|
We normally DO consider that case equal, but I think we discussed in some other issues that from a user point of view these are not equal. |
Without having thought much about this, I would have said that the indexes case (can be discussed, but mostly) is fine, while but assuming I'm wrong (i.e. current behavior is OK), then I just suggest replacing |
Closing this PR as discontinued. It's not in a state to be merged, and the user deleted the fork/branch it's based on. Opened #22462 as I think it's better to start from the beginning on this docstring. |
Make explicit that equals method requires that columns have the same dtypes but not that indices have the same types (e.g.
pd.DataFrame({1:[0], 0:[1]}).equals(pd.DataFrame({1.0:[0], 0.0:[1]}))
returnsTrue
whilepd.DataFrame({1:[0], 0:[1]}, dtype='float32').equals(pd.DataFrame({1:[0], 0:[1]}, dtype='float64'))
returnsFalse
)git diff upstream/master -u -- "*.py" | flake8 --diff