Lect 06 Network Analysis with Networkx Working with Data sets

Published: 25 May 2022
on channel: Data Science Center
4,338
28

Lect 06 Network Analysis with Networkx Working with Data sets

import networkx as nx
import pandas and pd
import matplotlib.pyplot as plt


user = ['user_from', 'user_to', 'trust']
df = pd.read_csv('E:/RSAlgorithms-master/ft_trust.txt', sep= ' ', names= user )

df.head()

G = nx.from_pandas_edgelist(df, source='user_from', target='user_to',edge_attr = 'trust', create_using= nx.DiGraph)

pos = nx.spring_layout(G)
plt.figure(figsize=(13, 13))
nx.draw_networkx_edge_labels(G,pos=pos, edge_labels=trust, font_size= 12 )
nx.draw_networkx(G, pos, with_labels=True, node_color='r', edge_color='g', node_size=1200, arrowsize= 30)
plt.show()


Watch video Lect 06 Network Analysis with Networkx Working with Data sets online, duration hours minute second in high quality that is uploaded to the channel Data Science Center 25 May 2022. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 4,338 times and liked it 28 visitors.