Answers for "compare non identical dataframes pandas"

3

comparing two dataframe columns

comparison_column = np.where(df["col1"] == df["col2"], True, False)
Posted by: Guest on November-04-2020
-1

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
Posted by: Guest on October-19-2020

Code answers related to "compare non identical dataframes pandas"

Python Answers by Framework

Browse Popular Code Answers by Language