I have few conditions to work upon, like -
1. if employment is 'salaried' or 'business' and annual income is '<=10 lakhs' and stp flagging is 'NON STP' then result should be 'No Issue'
2. if employment is 'salaried' or 'business' and annual income is '>10 lakhs' and stp flagging is 'STP' then result should be 'No Issue'
3. if employment is 'salaried' or 'business' and annual income is '>10 lakhs' and stp flagging is 'NON STP' then result should be 'Issue'
4. if employment is 'salaried' or 'business' and annual income is '<=10 lakhs' and stp flagging is 'STP' then result should be 'Issue'
I have tried this code -
df['Result'] = 'Null'
df['Result']=np.where((df['Employment']=='Salaried')|
(df['Employment']=='Business')&
(df['Annual income of policy owner']=='<= 10 lakh')&
(df['STP flagging'] == 'NON STP'),'No Issue','')
df['Result']=np.where((df['Employment']=='Salaried')|
(df['Employment']=='Business')&
(df['Annual income of policy owner']=='>10 lakh')&
(df['STP flagging'] == 'STP'),'No Issue','')
df['Result']=np.where((df['Employment']=='Salaried')|
(df['Employment']=='Business')&
(df['Annual income of policy owner']=='>10 lakh')&
(df['STP flagging'] == 'NON STP'),'Issue','')
df['Result']=np.where((df['Employment']=='Salaried')|
(df['Employment']=='Business')&
(df['Annual income of policy owner']=='<= 10 lakh')&
(df['STP flagging'] == 'STP'),'Issue','')
but only the last line is working, I need to assign the result for each and every condition. Please help me to modify the code.
'Result'column.