Intermediate Network Analysis in Python
Eric Ma
Data Carpentry instructor and author of nxviz package
Filtering graphs
Datetime
Visualization
list(G.edges(data=True))[0:5]
[(0, 17, {'sale_count': 1}),
(0, 18, {'sale_count': 1}),
(0, 19, {'sale_count': 2}),
(0, 12, {'sale_count': 14}),
(0, 13, {'sale_count': 9})]
[(u, v) for u, v, d in G.edges(data=True) if d['sale_count'] >= 10]
[(0, 12), (1, 19), (5, 16), (6, 13), (7, 17), (7, 19), (8, 18)]
from datetime import datetime, timedelta
year = 2011 month = 11 day1 = 10 day2 = 6
date1 = datetime(year, month, day1) date2 = datetime(year, month, day2)
date1 > date2
True
from nxviz import circos c = circos(G, group_by='bipartite', node_color_by='bipartite')
plt.show()
Intermediate Network Analysis in Python