line
line copied to clipboard
How to get co-authorship_graph.pkl?
Can you share the source dataset.
you can see the file in data folder,but i had a problem when i run the code
AttributeError: 'Graph' object has no attribute '_node'
@mellinging you can change you version of package networkx, I have the same problem and I try on another PC, this bug missing.
https://pypi.python.org/pypi/networkx/1.9.1 here is the .whl file you can download before you install the old version of networkx, remember to uninstall your latest networkx and then use pip3 install networkx-1.9.1-py2.py3-none-any.whl
Hello, I wonder whether the output is a graph too, because when I try to draw it using networkx1.9, there are some error in plt
@Uylee you should change version of network if there occurs some errors. you can reference my another answer.
@mellinging you can change you version of package networkx, I have the same problem and I try on another PC, this bug missing.
Hello, everyone! Here is the link of the official documents for Networkx about how to deal with the version problem: https://networkx.github.io/documentation/latest/release/migration_guide_from_1.x_to_2.0.html
and here is the code below:
in v1.x
pickle.dump([G.nodes(data=True), G.edges(data=True)], file)
then in v2.x
nodes, edges = pickle.load(file)
G = nx.Graph()
G.add_nodes_from(nodes)
G.add_edges_from(edges)
the graphs in 1.x and 2.x are different. So, we need to change the version to 1.x or change the graph given, all will work!!!