I have two dataframes, dfA and dfB of identical columns. I'm looking to get only the records from dataframe dfB that are not present in dataframe dfA.
to be clear, I do not want to get the records in dfA that are not in dfB.
I managed to hack something together that works using this, but the code is not easy to understand and by extension not very pythonic.
I'm looking for a more elegant solution, perhaps using pandas join/merge/append but wasn't able to make it work.
Example of what I want:
dfA:
Date Category Price
1 2013-11-24 Coat 22.1
2 2013-11-24 Shirt 8.7
3 2013-11-01 Socks 9 <<< Only present in this df
dfB:
Date Category Price
1 2013-11-24 Coat 22.1
2 2013-11-24 Shirt 8.7
3 2013-11-24 Helmet 2.1 <<< Only present in this df
4 2013-11-24 Pants 10.7 <<< Only present in this df
Result:
Date Category Price
1 2013-11-24 Helmet 2.1
2 2013-11-24 Pants 10.7