Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get co-authorship_graph.pkl? #1

Open
ynuwm opened this issue Jan 22, 2018 · 6 comments
Open

How to get co-authorship_graph.pkl? #1

ynuwm opened this issue Jan 22, 2018 · 6 comments

Comments

@ynuwm
Copy link

ynuwm commented Jan 22, 2018

Can you share the source dataset.

@mellinging
Copy link

you can see the file in data folder,but i had a problem when i run the code

@mellinging
Copy link

AttributeError: 'Graph' object has no attribute '_node'

@ynuwm
Copy link
Author

ynuwm commented Jan 27, 2018

@mellinging you can change you version of package networkx, I have the same problem and I try on another PC, this bug missing.

@ss87021456
Copy link

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

@ynuwm
Copy link
Author

ynuwm commented May 25, 2020

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.

@Uylee
Copy link

Uylee commented May 25, 2020

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!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants