This is a simplifeid version of my database.
A B
Store Product Year
A 1 2014 12 63
2 2015 32 5
3 2016 45 0
B 1 2014 45 0
2 2015 6 19
3 2016 7 4
C 1 2014 98 5
2 2015 54 43
3 2016 28 0
D 1 2014 4 6
2 2015 32 67
3 2016 1 5
I am trying to select all stores for where the value in column B in 2016 is zero. So in this instance I wish to select store A and C.
df = df[df['B']==0]
Only selects the individual rows where B = 0. Whereas want I want is to select this
A B
Store Product Year
A 1 2014 12 63
2 2015 32 5
3 2016 45 0
C 1 2014 98 5
2 2015 54 43
3 2016 28 0
Thanks in advance for help or advice.