diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 4668f264000e7..c1cb24cb9bffa 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -5932,14 +5932,23 @@ def _construct_result(self, result) -> "DataFrame": The resulting index will be a MultiIndex with 'self' and 'other' stacked alternately at the inner level. +Raises +------ +ValueError + When the two DataFrames don't have identical labels or shape. + See Also -------- Series.compare : Compare with another Series and show differences. +DataFrame.equals : Test whether two objects contain the same elements. Notes ----- Matching NaNs will not appear as a difference. +Can only compare identically-labeled +(i.e. same shape, identical row and column labels) DataFrames + Examples -------- >>> df = pd.DataFrame(