python - Iterating through a loop at the same rate with different variables -
i trying figure out how iterate through loop @ same time. not sure if wording question properly.
for example, need difference of column 1 both dataframes stored in calibrated power 0 [dbm]
or column 4 of df. need column 2 stored in calibrated power 10 [dbm]
column. @ moment, same data being copied columns 4-6 of df
attenuator_power = [0, 10, 30] in range(1, 3): ydata_sans_att = df_sans_attenuator.iloc[:, i] ydata_df = df.iloc[:, i] j in attenuator_power: df['calibrated power {} [dbm]'.format(j)] = ydata_df - ydata_sans_att
this how pair them:
for i, j in zip(range(1,3), attenuator_power): ydata_sans_att = df_sans_attenuator.iloc[:, i] ydata_df = df.iloc[:, i] df['calibrated power {} [dbm]'.format(j)] = ydata_df - ydata_sans_att
Comments
Post a Comment