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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -