I have below data. These are satellite number ,its state and value. Here Value of status 'B' is changing either 0 or some value. Value of status 'A' is always 0. Sat with status A and Val=0 for corresponding status 'B'is not acceptable and not counted.
My aim is to iterate through each row and find correct Satellite present at each row. If any row is all A or B=0 that row is not counted.
So my desire output is : a=3,1,1,1 Count=4 ,Row 4 is not counted
sv-01 sv-02 SV-03 state-01 state-02 state-03 val-01 val-02 val-03
7 12 8 B B B .23 0.34 1.03
7 12 8 B B A .35 0 0
7 12 8 B A A 1.45 0 0
7 12 8 A A A 0 0 0
7 12 8 A B B 0 0 3.21
# My python implementation is
mask = read_data.filter(like='state').eq('A')
result_count_Nj1 = mask.sum(axis=1).rsub(3)
# I have tried
mask = read_data.filter(like='state').eq('A') and read_data.filter(like='state').eq('B'!=0)
# But it shows error. Please suggest where I am making mistake
Thanks