O'Reilly logo

Python Social Media Analytics by Michal Krystyanczuk, Siddhartha Chatterjee

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Finding influencers

The aim of the second analysis is to find influencers by the popularity of topics they publish. In contrast to the most common social network, we will not deal with the number of followers or repins, but we will focus on created content.

We adjust function centrality_measures to generate bar charts instead of lists of results:

 def centrality_measures(G,labels): centralities = [] centralities.append(('degree centrality',nx.degree_centrality(G))) centralities.append(('closeness centrality',nx.closeness_centrality(G))) centralities.append(('betweenness centrality',nx.betweenness_centrality(G))) centralities.append(('eigenvector centrality',nx.eigenvector_centrality(G))) for centrality in centralities: sorted_elements = sorted(centrality[1].items(), ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required