Im sure this has been asked before but i cannot phrase it in a way such that I find a similar question. What I would like to do is drop rows of my dataframe where rows with the same item name that all have value of 0 are dropped.
For example. One of my columns is the 'itemname' and the other is the 'value'. the 'itemname' may be repeated many times. I want to check for each 'itemname', if all other items with the same name have value 0, then drop these rows
I know this should be simple, however I cannot get my head around it.
Just to make it clearer, here
itemname value
0 a 0
1 b 100
2 c 0
3 a 0
4 b 75
5 c 90
As all a items have a value of 0, They should be dropped.
itemname value
1 b 100
2 c 0
3 b 75
4 c 90
Hope that makes sense. I check if someone else has asked something similar and couldnt find something in this case.