I have a df
.. | Doc2 | DayType |
---|---|---|
.. | NaN | 0 |
.. | PQ | Holiday |
.. | NaN | Holiday |
.. | PJ | 0 |
I have to form a new column 'AssistanceFactor' such that its value is 1 if Doc2 is NaN and DayType is 'Holiday'
1 if Doc2 is not Nan and DayType is 'Holiday'
0.75 if Doc2 is not Nan and DayType is not 'Holiday'
1 if Doc2 is not NaN and DayType is not 'Holiday'
What would be the best method for this? I tried iterrows and conditions as well as np.select /where. But I am not getting the hang of it.
Thanks in advance