Francesc Segura
unread,Jul 13, 2011, 6:24:24 PM7/13/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to networkx-discuss
Hello,
I create a .dat file with the data of my graph by using:
nx.write_edgelist(best_graph,'optimal-graph.dat')
But then, if I try to read it with the command:
G=nx.read_edgelist("optimal-graph.dat")
It gives an error like this one:
"Failed to convert edge data (%s) to dictionary."%(d))
TypeError: Failed to convert edge data ([u'(7,', u'4)', u'{}']) to
dictionary."
The file data has an aspect like this:
(7, 3) (14, 11) {}
(7, 3) (9, 1) {}
It is due to the data format? What can I do to read properly the data
in the file?