April 2019
Beginner
190 pages
4h 54m
English
Network snapshots can also be used to analyze the evolution of network properties over time. The following code creates snapshots of the Dutch Wikipedia at one-month intervals over the course of two years and calculates the average clustering of the network at each time:
year = 2001month = 10clustering = []for i in range(24): date = '{}-{}-01'.format(year, month) G = get_snapshot(G_wiki, date) clustering.append(nx.average_clustering(G)) # Update month and year month += 1 if month > 12: month -= 12 year += 1
The results of the preceding code can be plotted using the following code:
# Create figureplt.figure(figsize=(7.5, 4))ax = plt.subplot(1, 1, 1)for spine in ax.spines.values(): spine.set_visible(True) ...
Read now
Unlock full access