I have a dataframe that defines list of call (call)[List]. each call has an answer status (call)[Status]. I created a column to have a unique field (call)[Key]
Call DataFrame which appears as following:
a = {'List':['List1','List1','List1','List1','List2','List3','List3','List1','List2','List2', 'List3'],
'Status': ['A', 'A', 'DO','A','A', 'A', 'DO','C','A', 'A', 'A'],
'Key': ['List1 2022-02-09', 'List1 2022-02-09', 'List1 2022-02-09','List1 2022-02-09','List2 2022-02-09', 'List3 2022-02-09', 'List3 2022-02-09','List1 2022-02-10','List2 2022-02-10', 'List2 2022-02-10', 'List3 2022-02-10']}
call = pd.DataFrame(data = a)
A seconde Dataframe with a calculated column (DimsDrops)[# drop] ; The join with the (Call)table is done with the (Call)[Key].
DimsDrops table which appears as following:
b = {'Key': ['List1 2022-02-09', 'List2 2022-02-09', 'List3 2022-02-09','List1 2022-02-10', 'List2 2022-02-10', 'List3 2022-02-10'],
'# drop': [2,1,1,0,1,1]}
DimsDrops = pd.DataFrame(data = b)
I want deleting the rows based on (DimsDrops)[# drop] and with (call)[Status] = "A"
Desired result is the following:
| List | Status | Key
--------------------------------------------------
| List1 | A | List1 2022-02-09
| List1 | DO | List1 2022-02-09
| List3 | DO | List3 2022-02-09
| List1 | C | List1 2022-02-10
| List2 | A | List2 2022-02-10
By using call.drop( export.query('Status = "A" & ...).index, inplace= True)), I am blocked how to recover the number of line to delete by making the join with "key"