I am a naive Python programmer and using it for my network data, so pardon me if this sounds silly. I have a two mode network with individuals and organisations. I have this as an edge list saved as a CSV file that I import to python. I have managed to read the CSV, project the graph into a bipartite network and export the file to gephi. After doing this, I am calculating the centrality (degree, eigenvector, closeness and betweenness) for my one mode projected and weighted graph. My code is as follows:
organisation_nodes, individual_nodes = bipartite.sets(B)
individual_nodes = set(n for n,d in B.nodes(data=True) if d['bipartite']==1)
organisation_nodes = set(B) - individual_nodes
organisation_graph = bipartite.weighted_projected_graph(B, organisation_nodes)org = bipartite.projected_graph(B, organisation_nodes)
print nx.info(org)
#degree centrality
deg_cent = nx.degree(org)
between_cent = nx.betweenness_centrality(org)
print between_cent
eigenvect_cent = nx.eigenvector_centrality(org)
print eigenvect_cent
close_cent = nx.closeness_centrality(org)I visualised the graphml file that I got from the projected network onto Gephi and calculated the centrality measures there. However, there is a discrepancy in the centrality values calculated by Gephi and NetworkX. Only the density and the degree centrality values match. Is there something wrong with my code? If not, why the difference? Any help would be greatly appreciated, Thanks
--
You received this message because you are subscribed to the Google Groups "networkx-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to networkx-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to networkx-discuss@googlegroups.com.
Visit this group at https://groups.google.com/group/networkx-discuss.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to networkx-discu...@googlegroups.com.
To post to this group, send email to networkx...@googlegroups.com.