Remove rows of one Dataframe based on one column of another dataframe

I got two DataFrame and want remove rows in df1 where we have same value in column ‘a’ in df2. Moreover one common value in df2 will only remove one row.

df1=pd.DataFrame({'a':[1,1,2,3,4,4],'b':[1,2,3,4,5,6],'c':[6,5,4,3,2,1]})

df2=pd.DataFrame({'a':[2,4,2],'b':[1,2,3],'c':[6,5,4]})

result=pd.DataFrame({'a':[1,1,3,4],'b':[1,2,4,6],'c':[6,5,3,1]})

Go to Source
Author: Sarim Nabi