I want to remove an edge attribute from a Graph object in python-igraph
. The equivalent igraph R function is cleverly called delete_edge_attr
. I haven't been able to find an equivalent function/method in Python... is there one?
If not, is there another way to do it? (I tried a simple g.es['edge_attr']= []
but this didn't work).
Example Code
g = ig.Graph.Tree(10, 2) #Generate random graph
g_betweenness = g.betweenness() #Calculate betweenness for graph
g['betweenness'] = betweenness #Assign betweenness as edge attribute
print(g.attributes())
g['betweenness'] = [] #Attempt to remove betweenness edge attribute (incorrect)
print(g.attributes())
Output
['betweenness']
['betweenness']
Desired output
['betweenness']
[]