I tried with drop() but it deletes both the rows. I even tried to transpose the dataframe and then delete the column, but it deletes both the columns. Note that I do not want to use row number to exclude the row. I want to delete one of the rows using the value in some other column. Thank you in advance!!
purchase_1 = pd.Series({'Name': 'Chris',
'Item Purchased': 'Dog Food',
'Cost': 22.50})
purchase_2 = pd.Series({'Name': 'Kevyn',
'Item Purchased': 'Kitty Litter',
'Cost': 2.50})
purchase_3 = pd.Series({'Name': 'Vinod',
'Item Purchased': 'Bird Seed',
'Cost': 5.00})
purchase_4 = pd.Series({'Name': 'Vinod',
'Item Purchased': 'Dog Food',
'Cost': 5.00})
df1 = pd.DataFrame([purchase_1, purchase_2, purchase_3, purchase_4], index=['Store 1', 'Store 1', 'Store 2', 'Store 2'])
'''
df::
Name Item Purchased Cost
Store 1 Chris Dog Food 22.5
Store 1 Kevyn Kitty Litter 2.5
Store 2 Vinod Bird Seed 5.0
Store 2 Vinod Dog Food 5.0
'''
Expected output::
One of the 'Store 1' rows deleted using values from some other column value like 'Dog Food' or 'Kitty Litter' or 22.5 or 2.5