I want to change values greater than 70 in column CT_feat7 but it only changes till 59000. After that, I have to run the iteration again, with a different index value.
Please, explain why this happens. Is there a better way? Dataset before replacement. After I run this code:
for index,j in enumerate(df['CT_feat7']):
  if j>70:
    df.loc[index,'CT_feat7'] = 11+random.random()
values are changed only up to index 59180.
i,j = 59180,2
while i <= 99195:
  if df.loc[i,'CT_feat7']>70:
    df.loc[i,'CT_feat7'] = j
    j+=0.1
    if j>12:
      j=2
  i+=1
 
     
    