python学习论坛或者社区,推荐,
我是在B站上看的视频学习,近期在一个叫做小猿圈的网站看视频,里面挺好的,讲解的非常细致,有简单的入门,还有难的知识。
如何强行卸载自己windows下的python-CSDN论坛
你指的论坛是网页上的那个?那是在你那里卸载不了的,要到服务端那边去卸载。
怎样基于python networkx实现社区发现
k_clique_communities的input是G,networkx的graph的数据结构。 原链接的test.txt文件应该是包涵一个graph件。
networkx可以读取的graph文件如链接。Reading and writing graphs
常见的类型有edgelist (usually stored as a text file)和GML。如果我们用Network data 的dolphins social network (which is stored as a GML file)做例子的话,运行如下的code:
import networkx as nx import matplotlib.pyplot as plt G = nx.read_gml('dolphins.gml')klist = list(nx.k_clique_communities(G,3)) #list of k-cliques in the network. each element contains the nodes that consist the clique.#plottingpos = nx.spring_layout(G)plt.clf()nx.draw(G,pos = pos, with_labels=False)nx.draw(G,pos = pos, nodelist = klist[0], node_color = 'b')nx.draw(G,pos = pos, nodelist = klist[1], node_color = 'y')plt.show()
我们的到如下结果:
版权声明:本站所有文章皆为原创,欢迎转载或转发,请保留网站地址和作者信息。