There are multiple posts about creating dictionaries with multiple values per key but I am missing what I am doing wrong.
I want to create a dictionary with selected col headers from a dataframe as keys. There should be two values:
value1 = mean of first ten values in the column value2 = mean of last ten values in the column
band_list = ['A', 'B', 'D', 'E', 'F']
def mean_ten(df, band_list):
mean_dict = {}
for wave in band_list:
col = df.columns.get_loc(wave);print(col)
mean_dict[wave] = df.iloc[:9, col].mean(axis=0)
mean_dict[wave].append(df.iloc[-10:,col].mean(axis = 0))
#Convert dictionary to df and return