Lect 07: Bipartite Graphs with Networkx ||Bipartite Graphs using Python

preview_player
Показать описание
Edges are only allowed across different sets and are not allowed within nodes belonging
to the same set. In most cases, nodes belonging to different sets are also characterized by
particular node types.

user = ['A', 'B', 'C', 'D', 'E']
item = [1, 2, 3, 4, 5]

Edge = pd.DataFrame([{"source":user, "target":item} for user, item in E])
G.add_nodes_from(user, bipartite=0)
G.add_nodes_from(item, bipartite=1)

Рекомендации по теме
visit shbcf.ru