I am trying to filter all the columns in a dataframe for the same value:
This is my dataframe:
df=pd.DataFrame({'A':['valid','invalid','valid'],'B':['valid','valid','valid'],'C':['valid','invalid','invalid']})
I want the just the records which has only value 'valid'
What i tried was:
udf=(lambda x: x=='valid')
df1=df.applymap(udf)
df1
A B C
0 True True True
1 False True False
2 True True False
again i dont know have to filter the records that has True alone. how do i do it?
Actual df output
A B C
0 valid valid valid
1 invalid valid invalid
2 valid valid invalid
Expected ouput
A B C
0 valid valid valid
can someone help me?