I´m trying to create a Df to put together the time vol of the pairs. Thereby, I tried the code below. It is working, but, wondering a way more dynamically dealing with list append to DF. Any help will be appreciated.. Thanks in advance!
time = []
for i in (dfeuh,dfguh,dfuch,dfujh,dfauh,
dfnuh,dfejh,dfegh,dfgjh,dfuchh,dfgoldh,dfdaxh):
a = i.groupby(by='Time')['Ch Pip H'].mean()
.sort_values(ascending=False).head(1)
time.append(a)
df = pd.DataFrame(time[0])
df1 = pd.DataFrame(time[1])
df2 = pd.DataFrame(time[2])
df3 = pd.DataFrame(time[3])
df4 = pd.DataFrame(time[4])
df5 = pd.DataFrame(time[5])
df6 = pd.DataFrame(time[6])
df7 = pd.DataFrame(time[7])
df8 = pd.DataFrame(time[8])
df9 = pd.DataFrame(time[9])
df10 = pd.DataFrame(time[10])
df11= pd.DataFrame(time[11])
dfto = pd.concat([df,df1,df2,df3,df4,df5,df6,df7,df8,
df9,df10,df11],ignore_index=False)
pairs = ['EU','GU','UC','UJ','AU','NU','EJ',
'EG','GJ','UCH','GOLD','DAX']
dfto['Ch Pip H'] = pairs
dfto = dfto.reset_index()
dfto.set_index(['Ch Pip H'],inplace=True)
col = ['Time Vol Max']
dfto.columns = col