I have a dataframe with three levels, let's call them Class -> Group -> Value:
Class Group Value Fail
A 1 0 False
A 1 1 True
A 2 0 False
A 2 1 True
A 2 2 True
A 3 2 True
A 3 5 True
B 4 2 False
B 4 7 True
B 4 8 True
B 4 12 True
B 4 15 True
B 5 1 False
B 5 2 False
B 5 3 True
B 6 7 False
B 6 8 False
I need to get the groups where the minimal value in a group is equal to the minimal value in a class where Fail==True:
Class Group Value Fail
A 1 0 False
A 1 1 True
A 2 0 False
A 2 1 True
A 2 2 True
B 5 1 False
B 5 2 False
B 5 3 True
So in the class A the minimal value with Fail==True is 1, and it is in the groups 1 and 2. in the class B the minimal value with Fail==True is 3 in the group 5.
How to do this?