1
Basically, I have a Dataframe (Database) that contains all the data registered in my system:
data = {"Id": ["01", "02", "03", "04",'05'],"Fruta": ['Maçã','Abacaxi','Banana','Laranja','Morango']}
base_dados = pd.DataFrame(data)
display(base_dados)
Id Fruta
0 01 Maçã
1 02 Abacaxi
2 03 Banana
3 04 Laranja
4 05 Morango
And I have another Dataframe (Production) with the items produced that contain items that are already in the database, as new items that are not there, in the example I quoted a Watermelon and the Melon.
data = {"Id": ["01", "03",'05','06','07'],"Fruta": ['Maçã','Banana','Morango','Melancia','Melao']}
producao = pd.DataFrame(data)
display(producao)
Id Fruta
0 01 Maçã
1 03 Banana
2 05 Morango
3 06 Melancia
4 07 Melao
What I need is to capture in python through pandas, capture only the items that are not in the database yet so I can be doing his treatment in the future.
Example of expected result:
Id Fruta
0 06 Melancia
1 07 Melao
Friend, that’s exactly it, it worked perfectly. Thank you!!
– Bruno Machado