Loop through dataframe one by one (pandas)
问题 Let's say we have a dataframe with columns A, B and C: df = pd.DataFrame(columns =('A','B','C'), index=range(1)) The columns holds three rows of numeric values: 0 A B C 1 2.1 1.8 1.6 2 2.01 1.81 1.58 3 1.9 1.84 1.52 How does one loop through every row from 1 to 3 and then execute an if statement including add some variables: if B1 > 1.5 calc_temp = A1*10 calc_temp01 = C1*-10 if B2 > 1.5 calc_temp = A2*10 calc_temp01 = C2*-10 if B3 >1.5 calc_temp = A3*10 calc_temp01 = C3*-10 Is above even