I have a data frame like :
label1 label2 amount
1 1 100
1 2 20
1 3 10
1 4 50
1 5 20
1 6 100
2 1 20
2 2 10
2 3 50
2 4 20
2 5 100
2 6 20
3 1 10
3 2 50
3 3 20
3 4 100
3 5 20
3 6 10
4 1 50
4 2 20
4 3 10
4 4 50
4 5 20
4 6 100
5 1 10
5 2 50
5 3 20
5 4 100
5 5 20
5 6 10
6 1 10
6 2 50
6 3 20
6 4 100
6 5 20
I've created a directed Gragh from networkx that, label1 and label2 are nodes and amount is weight of edges, I want to have the edges weights like the sum of amount between nodes for example between nodes 1 and 2 the weight calculated 60, but networkx consider 50 as weight.
is there any way to add custom function that calculate sum of amounts as weight?