I have two series, one having the company stock volume for all the many stocks across many exchanges (a lot of the stocks trade in all the exchanges). The other series is of the standard deviation of each stock (each company, irrespective of the exchanges they are traded in). Now, I have been trying to create a loop, to divide the volume of the respective stock (in first series) with the combined standard deviation that is in the second series. I made the following loop:
#for standard deviation of volume of each stock across all exchanges.(it is working properly)
stdev_volume = Main_df_retvol.groupby(['pair_name'], sort=False)['volume'].std()
#loop to divide the volume by the standard deviation of volume of respective stock.(loop not working)
df_vol_std = []
for i in range(len(stdev_volume)):
if stdev_volume[i]['pair_name'] == Main_df_retvol['pair_name']:
df_vol_std = Main_df_retvol['vol'].divide(other = stdev_volume['Volume'])
print(df_vol_std)
Any help would be really appreciated.