Skip to content

Commit 3a19556

Browse files
authored
DOC: Add note to docstring DataFrame.compare about identical labels (#35492)
* [IMP] - #35491 - added note docstring * [FIX] - #35491 - remove trailing whitespace * [IMP] - #35491 - added explanation about shape * [FIX] - #35491 - labelS * [FIX] - 35491 - removed add * added Raises section * Fix raise section * Removed trailing whitespace * Adjustments after review * Removed trailing whitespace
1 parent 24df602 commit 3a19556

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pandas/core/frame.py

+9
Original file line numberDiff line numberDiff line change
@@ -5891,14 +5891,23 @@ def _construct_result(self, result) -> DataFrame:
58915891
The resulting index will be a MultiIndex with 'self' and 'other'
58925892
stacked alternately at the inner level.
58935893
5894+
Raises
5895+
------
5896+
ValueError
5897+
When the two DataFrames don't have identical labels or shape.
5898+
58945899
See Also
58955900
--------
58965901
Series.compare : Compare with another Series and show differences.
5902+
DataFrame.equals : Test whether two objects contain the same elements.
58975903
58985904
Notes
58995905
-----
59005906
Matching NaNs will not appear as a difference.
59015907
5908+
Can only compare identically-labeled
5909+
(i.e. same shape, identical row and column labels) DataFrames
5910+
59025911
Examples
59035912
--------
59045913
>>> df = pd.DataFrame(

0 commit comments

Comments
 (0)