I have two data frames:
df1 = pd.DataFrame({'System':['b0001','b0002']})
df2 = pd.DataFrame({'System':['b0001']})
I want to print the value in the System of df1 column, which is NOT contained in the System of df2 column. The output should be only:
b0002
My current code is:
for i in df1.index:
if df1.System[i] not in df2.System:
print (df1.System[i])
But the way out:
b0001
b0002
I canβt understand why he is still typing b0001. I tried with isin, and the result is the same.
Any help would be appreciated.
source
share