I have a dataframe from which I am trying to add attributes to my graph edges. dataframe having mean_travel_time which is going to be the attribute for my edge
Plus, I have a data list which consists of source nodes and destination nodes as a tuple, like this. [(1160, 2399), (47, 1005)]
Now, while using set_edge_attribute to add attributes, I need my data into a dictionary: {(1160, 2399):1434.67, (47, 1005):2286.10, }
I did something like this:
data_dict={}#Empty dictionary
for i in data:
data_dict[i] = df1['mean_travel_time'].iloc[i]#adding values
But, I am getting error saying too many indexers Can anyone help me out with the error?