[Documentation] We are not alone - Social network analysis and visualization

Social Network Analysis and Visualization

Goal: Learn something about our social connections here at the Science Hack Day by analyzing and visualizing the Twitter network of SHD participants.


  • Ellen König
  • Tom Beutin
  • Syennie Valeria


  • Software (Python)


We used

  • jupyter for running the notebooks
  • python-twitter for accessing the Twitter API
  • networkx for Social network and graph analysis
  • matplotlib for basic graph visualization
  • audiolazy for the sound “visualization”

From the Twitter API, we fetched the follower lists for the most recent tweeters using the #shdb17 hashtag and the science hack day attendee twitter list curated by the orga team at https://twitter.com/SHD_Berlin/lists/shd-berlin-2017.
Due to the strict API rate limiting on Twitter’s side, we had to run the data collection over night and pause whenever the rate limit was exceeded (the API library we used offers that as a setting).

We then feed the follower lists into the NetworkX library to create a graph, draw a basic network visualization and compute some per-node social network metrics (betweenness, closeness, in_degree_centrality, out_degree_centrality). The graph was limited to only include follower links between the attendees, ignoring all other followers,

As a last step, we used the computed 4 metrics per attendee to iterate over the graph and turn each tweeter into a sound. We varied the following sound parameters based on the metrics

  • Pitch: Closeness
  • Length: In_degree
  • Volume: Out_degree
  • Pause: Betweeness

To make the result a bit more pleasant sounding, the pitches were mapped only on sounds from the pentatonic scale.





1 Like