I have two data frames with the same columns, but potentially different data. I want to find the difference between the two data frames and output a new data frame that contains only the rows that are unique to each data frame.
Here’s a sample code for my two dataframes:
import pandas as pd
df1 = pd.DataFrame({'A': [1, 2, 3, 4], 'B': [10, 20, 30, 40]})
df2 = pd.DataFrame({'A': [3, 4, 5, 6], 'B': [30, 40, 50, 60]})
Can someone help me find the difference between two data frames in Python? Thank you!