pandas how to compare if two dataframes are the equal code example
Example 1: comparing two dataframe columns
comparison_column = np.where(df["col1"] == df["col2"], True, False)
Example 2: pandas two dataframes equal
>>> df = pd.DataFrame({1: [10], 2: [20]})
>>> exactly_equal = pd.DataFrame({1: [10], 2: [20]}) # Note the same as above
>>> df.equals(exactly_equal)
True
# Two are the same hence true. If not would be false