I want to iterate over the column "Name" which should have only "ROSE" and the next column should be "Fail" and should extract the column "places" corresponding to the FAIL and ROSE.
Output :
I want to iterate over the column "Name" which should have only "ROSE" and the next column should be "Fail" and should extract the column "places" corresponding to the FAIL and ROSE.
Output :
df[(df["Name"] == "Rose") & (df["Condition"] == "Fail")]
Output
Name Status Place
0 Rose Fail India
1 Rose Fail USA
2 Rose Fail X
To fetch only Place column as a list
df[(df["Name"] == "Rose") & (df["Condition"] == "Fail")]["Place"].tolist()
Output
['India', 'USA', 'X']