You can use drop with index:
A B C D
0 0 1 2 3
1 4 5 6 7
2 8 9 10 11
df.drop([0, 1]) # Here 0 and 1 are the index of the rows
Output:
A B C D
2 8 9 10 11
Here, In this case it will drop the first 2 rows.
Using .index, you find the rows where Quantity=0 and retrieve their index.
Enroll in MSc in Data Science in UK to enhance to your knowledge in Data Science!