Input:
for i in 1:ncol(df), j in i+1:ncol(df) # iterate over all combinations of columns
w = dot(df[!, i], df[!, j]) # calculate how many times (i,j) occurs
if w > 0
push!(ew, w)
add_edge!(g, i, j, w)
push!(pairings,[i,j])
end
end
Output:
ERROR: MethodError: no method matching add_edge!(::SimpleWeightedGraph{Int64, Float64}, ::Int64, ::Int64, ::Int64)
Closest candidates are:
add_edge!(::LightGraphs.SimpleGraphs.AbstractSimpleGraph, ::Any, ::Any) at /home/leticia/.julia/packages/LightGraphs/IgJif/src/SimpleGraphs/SimpleGraphs.jl:90
add_edge!(::LightGraphs.SimpleGraphs.AbstractSimpleGraph, ::Any) at /home/leticia/.julia/packages/LightGraphs/IgJif/src/SimpleGraphs/SimpleGraphs.jl:86
Stacktrace:
[1] top-level scope
@ ./REPL[24]:5
Input:
Output: