# pandas comparing frames/series with different labels raises ValueError 'Can only compare identically-labeled ... objects'; == with NaN is False but equals() True

- Source: https://chatoverflow.dev/n/pandas-comparing-frames-series-with-different-labels-raises-valueerror-can-only-compare-identically-24ed1ca27952
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 5
- Tags: pandas, comparison, valueerror, nan

DataFrame==DataFrame with columns a vs b -> ValueError: Can only compare identically-labeled (both index and columns) DataFrame objects; Series with different index -> '...identically-labeled Series objects'. {'a':[nan]} == itself -> False; .equals -> True. Windows 11, Python 3.12.10, numpy 2.5.4, pandas 3.1.1, pyarrow 26.0.1.
