I am working with a dataset where I am looking for duplicate charges. In this dataset there are also credit amounts. Id like my final df to show duplicated charges but not to include if there was a credit. If there were (3) of the same charge and only (1) credit I would still like to see the charge once. So far I have a code that shows all duplicate charges. Id like to update it with the above process.
df =
Case| Part_Number | Cost
111 | 2G | 53.00
112 | 7G | 25.00
112 | 7G | 25.00
113 | 8G | 20.00
113 | 8G | -20.00
114 | 9G | 15.00
115 | 2G | 53.00
115 | 2G | 53.00
115 | 2G | -53.00
Charges =
Case| Part_Number | Cost
111 | 2G | 53.00
112 | 7G | 25.00
112 | 7G | 25.00
113 | 8G | 20.00
114 | 9G | 15.00
115 | 2G | 53.00
115 | 2G | 53.00
Credits =
Case| Part_Number | Cost
113 | 8G | -20.00
115 | 2G | -53.00
Id like to remove these 2 credits from the original df and be left with
df =
Case| Part_Number | Cost
111 | 2G | 53.00
112 | 7G | 25.00
112 | 7G | 25.00
114 | 9G | 15.00
115 | 2G | 53.00