I have data of two dataframes
First dataframe:
Name price date
Apple 25 23-9-2021
Orange 35 23-9-2021
Banana 15 23-9-2021
Gauva 10 23-9-2021
Grapes 5 23-9-2021
Sapota 15 22-9-2021
Papaya 33 21-9-2021
Apple 20 23-9-2021
Orange 30 23-9-2021
Banana 10 23-9-2021
Gauva 10 23-9-2021
Grapes 5 23-9-2021
Apple 15 23-9-2021
Orange 25 23-9-2021
Banana 25 23-9-2021
Gauva 20 23-9-2021
Grapes 15 23-9-2021
Second dataframe:
Name price date
Apple 80 23-9-2021
Orange 100 23-9-2021
Banana 90 23-9-2021
Gauva 60 23-9-2021
Grapes 45 23-9-2021
In first dataframe sum all price values of same fruit name and do substraction i.e.,
I want to substract price value of two dataframes based on row values of same Name and Date and store it into first dataframe
Output: first dataframe
Name price date
Apple 25 23-9-2021
Orange 35 23-9-2021
Banana 15 23-9-2021
Gauva 10 23-9-2021
Grapes 5 23-9-2021
Sapota 15 22-9-2021
Papaya 33 21-9-2021
Apple 20 23-9-2021
Orange 30 23-9-2021
Banana 10 23-9-2021
Gauva 10 23-9-2021
Grapes 5 23-9-2021
Apple 15 23-9-2021
Orange 25 23-9-2021
Banana 25 23-9-2021
Gauva 20 23-9-2021
Grapes 15 23-9-2021
Apple 20 23-9-2021
Orange 10 23-9-2021
Banana 40 23-9-2021
Gauva 20 23-9-2021
Grapes 15 23-9-2021
I have more than hundred of such fruitnames.
I don't know how to do this
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…