I have the below dataframe:
Col1 Col2 Col3 Col4 Col5 Col6 Col7
1 A T 1 AG NBL NH
2 A T 1 NAG BL NH
3 A M 2 NAG NBL HL
4 NS M 1 NAG BL NH
5 NS T 1 NAG NBL HL
6 A M 2 NAG NBL HL
I want to create a new column based on this conditions:
IF Col5 = 'AG' AND Col2 = 'A' AND Col3 = 'M' AND Col4 = 1 Then *(In the NewColumn)* 'A1'
IF Col5 = 'AG' AND Col2 = 'A' AND Col3 = 'M' AND Col4 = 0 Then *(In the NewColumn)* 'A2'
IF Col6 = 'BL' AND Col2 = 'A' AND Col3 = 'M' AND Col4 = 1 Then *(In the NewColumn)* 'B1'
IF Col6 = 'BL' AND Col2 = 'A' AND Col3 = 'M' AND Col4 = 0 Then *(In the NewColumn)* 'B2'
IF Col7 = 'HL' AND Col2 = 'A' AND Col3 = 'M' AND Col4 = 1 Then *(In the NewColumn)* 'H1'
IF Col6 = 'HL' AND Col2 = 'A' AND Col3 = 'M' AND Col4 = 0 Then *(In the NewColumn)* 'H2'
I have many different conditions in the original df but I'm trying to create a way just to add this conditions. I'm working with phyton in jupyter