ich bin gerade dabei ein " dictionaries of dictionaries" in einen Dataframe zu überführen.
Mein Dict of dict besteht aus zwei default dicts.
Code: Alles auswählen
So soll der Dataframe später aussehen:
col = symbols_list[:]
ab_index = range(-window, window+1)
pos_data= pd.DataFrame(index=ab_index, columns=col)
So wollte ich mein Dict umwandeln:
for h in col:
if h in pos_dict.keys():
for z in ab_index:
pos_data[h][z] = np.mean([x.values()[z+window] for x in pos_dict[h].values()])
Code: Alles auswählen
pos_data_abret[h][z] = np.mean([x.values()[z+window] for x in pos_dict[h].values()])
TypeError: 'odict_values' object is not subscriptable
Besten Dank