pandas two dataframes equal

Solutions on MaxInterview for pandas two dataframes equal by the best coders in the world

showing results for - "pandas two dataframes equal"
Helena
24 Jan 2020
1>>> exactly_equal = pd.DataFrame({1: [10], 2: [20]})
2>>> exactly_equal
3    1   2
40  10  20
5>>> df.equals(exactly_equal)
6True
7
Federico
31 Sep 2016
1>>> df = pd.DataFrame({1: [10], 2: [20]})
2
3>>> exactly_equal = pd.DataFrame({1: [10], 2: [20]}) # Note the same as above
4
5>>> df.equals(exactly_equal)
6True
7# Two are the same hence true. If not would be false