Created
October 15, 2020 18:23
-
-
Save vessaldaneshvar/093fb690caae911d533db8fd5198a8a0 to your computer and use it in GitHub Desktop.
Create Directed Graph
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
G = nx.DiGraph() | |
G.add_nodes_from(df_users["id_str"], | |
name=df_users["name"], | |
screen_name=df_users["screen_name"], | |
description=df_users["description"], | |
url=df_users["url"], | |
followers_count=df_users["followers_count"], | |
friends_count=df_users["friends_count"], | |
listed_count=df_users["listed_count"], | |
created_at=df_users["created_at"], | |
favourites_count=df_users["favourites_count"], | |
statuses_count=df_users["statuses_count"]) | |
edge_weight_list = [(s,d,w) for _,(s,d,w) in df_group_relation.iterrows()] | |
G.add_weighted_edges_from(edge_weight_list) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment