Input Explained: I have a dataframe 'df', which holds columns 'Space' and 'Threshold'.
Space Threshold
TRUE 0.1
TRUE 0.25
FALSE 0.5
FALSE 0.6
Scenario to consider: When df['Space'] is TRUE, check df['Threshold']<=0.2 and if both condition satisfies generate a new column called df['Space_Test'] with value PASS/FAIL. If df['Space'] value is FALSE, put 'FALSE' as value to newly generated column df['Space_Test'].
Expected Output:
Space Threshold Space_Test
TRUE 0.1 PASS
TRUE 0.25 FAIL
FALSE 0.5 FALSE
FALSE 0.6 FALSE
Tried Code: Have tried out the below mentioned codeline for above mentioned scenario but doesn't works.
df['Space_Test'] = np.where(df['Space'] == 'TRUE',np.where(df['Threshold'] <= 0.2, 'Pass', 'Fail'),'FALSE')
In need of help to resolve this. Thanks in Advance!