Hello friends,
I have a weighted network stored in a .csv file. I need to import using a
csv.DictReader but also apply the weights in the column to the edges as we
import
reader = csv.DictReader(open("bigram-frequences.csv"),
dialect="excel")#bigram-tweets-raw.csv
g = igraph.Graph.DictList(vertices=None, edges=reader, directed=True)
A sample file of the network is attached.
Any help will be much appreciated,
-Ahmed
source,target,weight
adaptation,solutions,1.06594807554e-06
adaptation,story,5.32974037769e-06
adaptation,trend,5.32974037769e-07
adaptation,watch,5.32974037769e-07
addendum,addendum,1.59892211331e-06
addendum,supply,1.06594807554e-06
africas,energy,5.32974037769e-07
africas,future,5.32974037769e-07
africas,health,1.06594807554e-06
africas,population,5.32974037769e-07
africas,rise,5.32974037769e-07
africas,war,5.32974037769e-07
agency,accounting,1.59892211331e-06
agency,action,1.59892211331e-06
agency,agency,2.13189615107e-06
agency,ahead,1.59892211331e-06
agency,andrew,1.06594807554e-06
agency,approach,3.19784422661e-06
agency,assessing,1.06594807554e-06
agency,atlantic,5.32974037769e-07
agency,benefits,5.32974037769e-07
_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help