Greeting everyone,
I have this table (Without the Res_Problem):
ID | Problem | X | Impact | Prob | Res_Problem |
---|---|---|---|---|---|
ID1 | 12 | IDC1 | 1 | 2 | (12-2)=10 |
ID1 | 12 | IDC2 | 2 | 2 | (10-4)=6 STOP |
ID1 | 12 | IDC3 | 1 | 0 | NO LOOP |
ID1 | 12 | IDC4 | 1 | 0 | NO LOOP |
ID2 | 10 | IDB1 | 1 | 2 | New Loop (10-2)=8 |
ID2 | 10 | IDB1 | 1 | 2 | (8-2) = 6 STOP |
I want to do a loop that multiplies the Impact and prob until get a desire value (6 for example),and stop the loop until it reach the 6. but start again the loop on the ID2... and so on, any suggestions?
I think it has to be something like this :
while (df['Problem'] - df['Impact']*df['Impact'] < 6): df['loop'] = res
The loop should create the 'Res_Problem' column
Res_Problem
what you want result to displayed? Is theRes_Problem
just a example of the logic the loop solution should do or just part of the original data?