1
I have 2 dataframes, the df_a and df_b.
How do I compare them and show the information that is not contained in the dataframe df_a?
I tried to perform the Uplicates drop method, however, the output presents the distinct data between the two dataframes.
Below the example:
import pandas as pd
a = [1,2,3]
b = [1,2,5]
df_a = pd.DataFrame(a)
df_b = pd.DataFrame(b)
df_c = df_a.append(df_b)
df_d = df_c.drop_duplicates(keep=False)
df_d
That’s the way out:
0
2 3
2 5
My need is to show the output of the line containing the value 5 which is the value of df_b other than df_a.
Worked perfectly
– LePy