{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Import data and get things setup"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [],
   "source": [
    "import random\n",
    "random.seed(9001)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Populating the interactive namespace from numpy and matplotlib\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/lib/python3/dist-packages/IPython/core/magics/pylab.py:161: UserWarning: pylab import has clobbered these variables: ['sin', 'pi', 'median', 'random', 'percentile', 'save', 'deprecated', 'Rectangle', 'load', 'mean', 'plot', 'cos']\n",
      "`%matplotlib` prevents importing * from pylab and numpy\n",
      "  \"\\n`%matplotlib` prevents importing * from pylab and numpy\"\n"
     ]
    }
   ],
   "source": [
    "# turn on the magic so we have inline figures\n",
    "%pylab inline\n",
    "import matplotlib\n",
    "matplotlib.style.use('ggplot')\n",
    "from IPython.display import display"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [],
   "source": [
    "# import code to write r modules and create our variable we'll write to\n",
    "import rpy2.robjects as robjects\n",
    "from rpy2.robjects import pandas2ri\n",
    "pandas2ri.activate()\n",
    "\n",
    "r = {}\n",
    "def remember(name, x):\n",
    "    r[name] = x\n",
    "    display(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [],
   "source": [
    "# load in modules we'll need for analysis\n",
    "import subprocess\n",
    "import csv\n",
    "from igraph import *\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "import re"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "# grab the largest connected compontent with a little function\n",
    "def get_largest_component(g):\n",
    "    g_components = g.components(mode=\"WEAK\")\n",
    "    max_size = max(g_components.sizes())\n",
    "    for g_tmp in g_components.subgraphs():\n",
    "        if g_tmp.vcount() == max_size:\n",
    "            return(g_tmp)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [],
   "source": [
    "# look the full edgelist into igraph\n",
    "def edge_list_iter(df):\n",
    "    for i, row in df.iterrows():\n",
    "        yield (row['from'], row['to'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [],
   "source": [
    "# list top 5 journals for each of the clusters\n",
    "def top_journals_for_clusters(clu):\n",
    "    articles_tmp = pd.merge(clu, articles[['eid', 'source_title']])\n",
    "    \n",
    "    output = pd.DataFrame()\n",
    "    for cid in articles_tmp['cluster'].unique():\n",
    "        journal_counts = articles_tmp['source_title'][articles_tmp['cluster'] == cid].value_counts().head(5)\n",
    "        tmp = pd.DataFrame({'cluster' : cid, 'count' : journal_counts })        \n",
    "        output = output.append(tmp)\n",
    "\n",
    "    output = output.reset_index()\n",
    "    output = output.rename(columns = {'index' : \"journal\"})\n",
    "    return(output)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [],
   "source": [
    "def infomap_edgelist(g, edgelist_filename, directed=True):\n",
    "    nodes_tmp = pd.DataFrame([ {'node_infomap' : v.index, \n",
    "                                'eid' : v['name']} for v in g.vs ])\n",
    "\n",
    "    # write out the edgelist to an external file so we can call infomap on it\n",
    "    with open(edgelist_filename + \".txt\", 'w') as f:\n",
    "        for e in g.es:\n",
    "            if e.source != e.target:\n",
    "                if 'weight' in e.attributes():\n",
    "                    print(\"{}\\t{}\\t{}\".format(e.source, e.target, e['weight']), file=f)\n",
    "                else:\n",
    "                    print(\"{}\\t{}\".format(e.source, e.target), file=f)\n",
    "\n",
    "                    \n",
    "    # run the external program to generate the infomap clustering\n",
    "    infomap_cmdline = [\"infomap/Infomap\", edgelist_filename + \".txt\", \"output_dir -z --map --clu --tree\"]\n",
    "    if directed:\n",
    "        infomap_cmdline.append(\"-d\")\n",
    "    subprocess.call(infomap_cmdline)\n",
    "\n",
    "    # load up the clu data\n",
    "    clu = pd.read_csv(\"output_dir/\" + edgelist_filename + \".clu\",\n",
    "                      header=None, comment=\"#\", delim_whitespace=True)\n",
    "    clu.columns = ['node_infomap', 'cluster', 'flow']\n",
    "    \n",
    "    return pd.merge(clu, nodes_tmp, on=\"node_infomap\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [],
   "source": [
    "def write_graphml(g, clu, graphml_filename):\n",
    "    clu = clu[['node_infomap', 'cluster']].sort_values('node_infomap')\n",
    "    g.vs[\"cluster\"] =  clu[\"cluster\"].tolist()\n",
    "    g.write_graphml(graphml_filename)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [],
   "source": [
    "# load article data\n",
    "articles = pd.read_csv(\"../../processed_data/abstracts.tsv\", delimiter=\"\\t\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# network for just the central \"social media\" set"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [],
   "source": [
    "# this contains the list of all INCOMING citations to for paper in the original set\n",
    "raw_edgelist = pd.read_csv(\"../../processed_data/social_media_edgelist.txt\", delimiter=\"\\t\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [],
   "source": [
    "g_sm_all = Graph.TupleList([i for i in edge_list_iter(raw_edgelist)], directed=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [],
   "source": [
    "g_sm = get_largest_component(g_sm_all)\n",
    "g_sm = g_sm.simplify()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [],
   "source": [
    "g_sm_clu = infomap_edgelist(g_sm, \"sm_edgelist_infomap\", directed=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2     1817\n",
       "1     1748\n",
       "3     1088\n",
       "4      653\n",
       "6      355\n",
       "10     114\n",
       "5      104\n",
       "9       90\n",
       "8       59\n",
       "7       44\n",
       "12      27\n",
       "11      19\n",
       "13      10\n",
       "14       5\n",
       "15       3\n",
       "16       2\n",
       "18       1\n",
       "17       1\n",
       "Name: cluster, dtype: int64"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "g_sm_clu['cluster'].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "
\n",
       "\n",
       "
\n",
       "  \n",
       "    \n",
       "      | \n",
       " | journal\n",
       " | cluster\n",
       " | count\n",
       " | 
\n",
       "  \n",
       "  \n",
       "    \n",
       "      | 40\n",
       " | Lecture Notes in Computer Science (including s...\n",
       " | 9\n",
       " | 4\n",
       " | 
\n",
       "    \n",
       "      | 41\n",
       " | WSDM 2013 - Proceedings of the 6th ACM Interna...\n",
       " | 9\n",
       " | 4\n",
       " | 
\n",
       "    \n",
       "      | 42\n",
       " | Conference on Human Factors in Computing Syste...\n",
       " | 9\n",
       " | 2\n",
       " | 
\n",
       "    \n",
       "      | 43\n",
       " | WWW 2013 Companion - Proceedings of the 22nd I...\n",
       " | 9\n",
       " | 2\n",
       " | 
\n",
       "    \n",
       "      | 44\n",
       " | PLoS ONE\n",
       " | 9\n",
       " | 2\n",
       " | 
\n",
       "  \n",
       "
\n",
       "
\n",
       "\n",
       "
\n",
       "  \n",
       "    \n",
       "      | \n",
       " | journal\n",
       " | cluster\n",
       " | count\n",
       " | 
\n",
       "  \n",
       "  \n",
       "    \n",
       "      | 0\n",
       " | Public Relations Review\n",
       " | 1\n",
       " | 119\n",
       " | 
\n",
       "    \n",
       "      | 1\n",
       " | Lecture Notes in Computer Science (including s...\n",
       " | 1\n",
       " | 81\n",
       " | 
\n",
       "    \n",
       "      | 2\n",
       " | Computers in Human Behavior\n",
       " | 1\n",
       " | 71\n",
       " | 
\n",
       "    \n",
       "      | 3\n",
       " | Proceedings of the Annual Hawaii International...\n",
       " | 1\n",
       " | 49\n",
       " | 
\n",
       "    \n",
       "      | 4\n",
       " | Government Information Quarterly\n",
       " | 1\n",
       " | 40\n",
       " | 
\n",
       "    \n",
       "      | 5\n",
       " | Journal of Medical Internet Research\n",
       " | 2\n",
       " | 149\n",
       " | 
\n",
       "    \n",
       "      | 6\n",
       " | PLoS ONE\n",
       " | 2\n",
       " | 43\n",
       " | 
\n",
       "    \n",
       "      | 7\n",
       " | Studies in Health Technology and Informatics\n",
       " | 2\n",
       " | 41\n",
       " | 
\n",
       "    \n",
       "      | 8\n",
       " | Lecture Notes in Computer Science (including s...\n",
       " | 2\n",
       " | 32\n",
       " | 
\n",
       "    \n",
       "      | 9\n",
       " | Annals of Emergency Medicine\n",
       " | 2\n",
       " | 17\n",
       " | 
\n",
       "    \n",
       "      | 10\n",
       " | Lecture Notes in Computer Science (including s...\n",
       " | 3\n",
       " | 180\n",
       " | 
\n",
       "    \n",
       "      | 11\n",
       " | ACM International Conference Proceeding Series\n",
       " | 3\n",
       " | 51\n",
       " | 
\n",
       "    \n",
       "      | 12\n",
       " | International Conference on Information and Kn...\n",
       " | 3\n",
       " | 38\n",
       " | 
\n",
       "    \n",
       "      | 13\n",
       " | CEUR Workshop Proceedings\n",
       " | 3\n",
       " | 37\n",
       " | 
\n",
       "    \n",
       "      | 14\n",
       " | PLoS ONE\n",
       " | 3\n",
       " | 36\n",
       " | 
\n",
       "    \n",
       "      | 15\n",
       " | Information Communication and Society\n",
       " | 4\n",
       " | 70\n",
       " | 
\n",
       "    \n",
       "      | 16\n",
       " | New Media and Society\n",
       " | 4\n",
       " | 34\n",
       " | 
\n",
       "    \n",
       "      | 17\n",
       " | First Monday\n",
       " | 4\n",
       " | 24\n",
       " | 
\n",
       "    \n",
       "      | 18\n",
       " | Lecture Notes in Computer Science (including s...\n",
       " | 4\n",
       " | 23\n",
       " | 
\n",
       "    \n",
       "      | 19\n",
       " | Computers in Human Behavior\n",
       " | 4\n",
       " | 21\n",
       " | 
\n",
       "    \n",
       "      | 20\n",
       " | Computers in Human Behavior\n",
       " | 5\n",
       " | 42\n",
       " | 
\n",
       "    \n",
       "      | 21\n",
       " | Cyberpsychology, Behavior, and Social Networking\n",
       " | 5\n",
       " | 42\n",
       " | 
\n",
       "    \n",
       "      | 22\n",
       " | Personality and Individual Differences\n",
       " | 5\n",
       " | 11\n",
       " | 
\n",
       "    \n",
       "      | 23\n",
       " | Journal of Medical Internet Research\n",
       " | 5\n",
       " | 11\n",
       " | 
\n",
       "    \n",
       "      | 24\n",
       " | Journal of Adolescent Health\n",
       " | 5\n",
       " | 11\n",
       " | 
\n",
       "    \n",
       "      | 25\n",
       " | Computers in Human Behavior\n",
       " | 6\n",
       " | 38\n",
       " | 
\n",
       "    \n",
       "      | 26\n",
       " | Lecture Notes in Computer Science (including s...\n",
       " | 6\n",
       " | 24\n",
       " | 
\n",
       "    \n",
       "      | 27\n",
       " | Computers and Education\n",
       " | 6\n",
       " | 16\n",
       " | 
\n",
       "    \n",
       "      | 28\n",
       " | Conference on Human Factors in Computing Syste...\n",
       " | 6\n",
       " | 11\n",
       " | 
\n",
       "    \n",
       "      | 29\n",
       " | Journal of Marketing Education\n",
       " | 6\n",
       " | 11\n",
       " | 
\n",
       "    \n",
       "      | ...\n",
       " | ...\n",
       " | ...\n",
       " | ...\n",
       " | 
\n",
       "    \n",
       "      | 286\n",
       " | Medical Journal of Australia\n",
       " | 63\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 287\n",
       " | Nicotine and Tobacco Research\n",
       " | 63\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 288\n",
       " | 35th International Conference on Information S...\n",
       " | 64\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 289\n",
       " | First Monday\n",
       " | 64\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 290\n",
       " | Cyberpsychology, Behavior, and Social Networking\n",
       " | 64\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 291\n",
       " | HT'12 - Proceedings of 23rd ACM Conference on ...\n",
       " | 65\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 292\n",
       " | IEEE/ACM Transactions on Networking\n",
       " | 65\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 293\n",
       " | Journal of Healthcare Engineering\n",
       " | 65\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 294\n",
       " | International Journal of Information Management\n",
       " | 66\n",
       " | 2\n",
       " | 
\n",
       "    \n",
       "      | 295\n",
       " | Journal of Theoretical and Applied Electronic ...\n",
       " | 66\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 296\n",
       " | Journal of Experimental and Theoretical Artifi...\n",
       " | 66\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 297\n",
       " | McKinsey Quarterly\n",
       " | 66\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 298\n",
       " | Lecture Notes in Computer Science (including s...\n",
       " | 66\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 299\n",
       " | Science (New York, N.Y.)\n",
       " | 67\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 300\n",
       " | International Conference on Information and Kn...\n",
       " | 68\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 301\n",
       " | Lecture Notes in Computer Science (including s...\n",
       " | 68\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 302\n",
       " | 16th Americas Conference on Information System...\n",
       " | 68\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 303\n",
       " | Procedia Engineering\n",
       " | 68\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 304\n",
       " | International Journal of Virtual and Personal ...\n",
       " | 68\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 305\n",
       " | Scientometrics\n",
       " | 69\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 306\n",
       " | Conference on Human Factors in Computing Syste...\n",
       " | 70\n",
       " | 2\n",
       " | 
\n",
       "    \n",
       "      | 307\n",
       " | NyS\n",
       " | 71\n",
       " | 2\n",
       " | 
\n",
       "    \n",
       "      | 308\n",
       " | Aslib Proceedings: New Information Perspectives\n",
       " | 71\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 309\n",
       " | WWW 2013 Companion - Proceedings of the 22nd I...\n",
       " | 72\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 310\n",
       " | Cyberpsychology, Behavior, and Social Networking\n",
       " | 72\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 311\n",
       " | PACIS 2011 - 15th Pacific Asia Conference on I...\n",
       " | 73\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 312\n",
       " | Proceedings of the International Conference on...\n",
       " | 73\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 313\n",
       " | Online (Wilton, Connecticut)\n",
       " | 74\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 314\n",
       " | Catalan Journal of Communication and Cultural ...\n",
       " | 75\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 315\n",
       " | Proceedings - Pacific Asia Conference on Infor...\n",
       " | 75\n",
       " | 1\n",
       " | 
\n",
       "  \n",
       "
\n",
       "
316 rows × 3 columns
\n",
       "
\n",
       "\n",
       "
\n",
       "  \n",
       "    \n",
       "      | \n",
       " | to_cluster\n",
       " | from_cluster\n",
       " | value\n",
       " | 
\n",
       "  \n",
       "  \n",
       "    \n",
       "      | 1\n",
       " | 2\n",
       " | 1\n",
       " | 396\n",
       " | 
\n",
       "    \n",
       "      | 2\n",
       " | 3\n",
       " | 1\n",
       " | 278\n",
       " | 
\n",
       "    \n",
       "      | 3\n",
       " | 4\n",
       " | 1\n",
       " | 233\n",
       " | 
\n",
       "    \n",
       "      | 4\n",
       " | 5\n",
       " | 1\n",
       " | 171\n",
       " | 
\n",
       "    \n",
       "      | 5\n",
       " | 6\n",
       " | 1\n",
       " | 85\n",
       " | 
\n",
       "    \n",
       "      | 6\n",
       " | 7\n",
       " | 1\n",
       " | 57\n",
       " | 
\n",
       "    \n",
       "      | 7\n",
       " | 8\n",
       " | 1\n",
       " | 86\n",
       " | 
\n",
       "    \n",
       "      | 8\n",
       " | 9\n",
       " | 1\n",
       " | 25\n",
       " | 
\n",
       "    \n",
       "      | 9\n",
       " | 10\n",
       " | 1\n",
       " | 29\n",
       " | 
\n",
       "    \n",
       "      | 10\n",
       " | 11\n",
       " | 1\n",
       " | 12\n",
       " | 
\n",
       "    \n",
       "      | 11\n",
       " | 12\n",
       " | 1\n",
       " | 0\n",
       " | 
\n",
       "    \n",
       "      | 12\n",
       " | 13\n",
       " | 1\n",
       " | 3\n",
       " | 
\n",
       "    \n",
       "      | 13\n",
       " | 1\n",
       " | 2\n",
       " | 412\n",
       " | 
\n",
       "    \n",
       "      | 15\n",
       " | 3\n",
       " | 2\n",
       " | 117\n",
       " | 
\n",
       "    \n",
       "      | 16\n",
       " | 4\n",
       " | 2\n",
       " | 126\n",
       " | 
\n",
       "    \n",
       "      | 17\n",
       " | 5\n",
       " | 2\n",
       " | 187\n",
       " | 
\n",
       "    \n",
       "      | 18\n",
       " | 6\n",
       " | 2\n",
       " | 104\n",
       " | 
\n",
       "    \n",
       "      | 19\n",
       " | 7\n",
       " | 2\n",
       " | 175\n",
       " | 
\n",
       "    \n",
       "      | 20\n",
       " | 8\n",
       " | 2\n",
       " | 68\n",
       " | 
\n",
       "    \n",
       "      | 21\n",
       " | 9\n",
       " | 2\n",
       " | 16\n",
       " | 
\n",
       "    \n",
       "      | 22\n",
       " | 10\n",
       " | 2\n",
       " | 4\n",
       " | 
\n",
       "    \n",
       "      | 23\n",
       " | 11\n",
       " | 2\n",
       " | 3\n",
       " | 
\n",
       "    \n",
       "      | 24\n",
       " | 12\n",
       " | 2\n",
       " | 0\n",
       " | 
\n",
       "    \n",
       "      | 25\n",
       " | 13\n",
       " | 2\n",
       " | 4\n",
       " | 
\n",
       "    \n",
       "      | 26\n",
       " | 1\n",
       " | 3\n",
       " | 184\n",
       " | 
\n",
       "    \n",
       "      | 27\n",
       " | 2\n",
       " | 3\n",
       " | 150\n",
       " | 
\n",
       "    \n",
       "      | 29\n",
       " | 4\n",
       " | 3\n",
       " | 174\n",
       " | 
\n",
       "    \n",
       "      | 30\n",
       " | 5\n",
       " | 3\n",
       " | 345\n",
       " | 
\n",
       "    \n",
       "      | 31\n",
       " | 6\n",
       " | 3\n",
       " | 11\n",
       " | 
\n",
       "    \n",
       "      | 32\n",
       " | 7\n",
       " | 3\n",
       " | 99\n",
       " | 
\n",
       "    \n",
       "      | ...\n",
       " | ...\n",
       " | ...\n",
       " | ...\n",
       " | 
\n",
       "    \n",
       "      | 204\n",
       " | 10\n",
       " | 16\n",
       " | 0\n",
       " | 
\n",
       "    \n",
       "      | 205\n",
       " | 11\n",
       " | 16\n",
       " | 0\n",
       " | 
\n",
       "    \n",
       "      | 206\n",
       " | 12\n",
       " | 16\n",
       " | 0\n",
       " | 
\n",
       "    \n",
       "      | 207\n",
       " | 13\n",
       " | 16\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 208\n",
       " | 1\n",
       " | 17\n",
       " | 0\n",
       " | 
\n",
       "    \n",
       "      | 209\n",
       " | 2\n",
       " | 17\n",
       " | 0\n",
       " | 
\n",
       "    \n",
       "      | 210\n",
       " | 3\n",
       " | 17\n",
       " | 0\n",
       " | 
\n",
       "    \n",
       "      | 211\n",
       " | 4\n",
       " | 17\n",
       " | 3\n",
       " | 
\n",
       "    \n",
       "      | 212\n",
       " | 5\n",
       " | 17\n",
       " | 4\n",
       " | 
\n",
       "    \n",
       "      | 213\n",
       " | 6\n",
       " | 17\n",
       " | 0\n",
       " | 
\n",
       "    \n",
       "      | 214\n",
       " | 7\n",
       " | 17\n",
       " | 0\n",
       " | 
\n",
       "    \n",
       "      | 215\n",
       " | 8\n",
       " | 17\n",
       " | 2\n",
       " | 
\n",
       "    \n",
       "      | 216\n",
       " | 9\n",
       " | 17\n",
       " | 0\n",
       " | 
\n",
       "    \n",
       "      | 217\n",
       " | 10\n",
       " | 17\n",
       " | 0\n",
       " | 
\n",
       "    \n",
       "      | 218\n",
       " | 11\n",
       " | 17\n",
       " | 0\n",
       " | 
\n",
       "    \n",
       "      | 219\n",
       " | 12\n",
       " | 17\n",
       " | 0\n",
       " | 
\n",
       "    \n",
       "      | 220\n",
       " | 13\n",
       " | 17\n",
       " | 0\n",
       " | 
\n",
       "    \n",
       "      | 221\n",
       " | 1\n",
       " | 18\n",
       " | 3\n",
       " | 
\n",
       "    \n",
       "      | 222\n",
       " | 2\n",
       " | 18\n",
       " | 0\n",
       " | 
\n",
       "    \n",
       "      | 223\n",
       " | 3\n",
       " | 18\n",
       " | 0\n",
       " | 
\n",
       "    \n",
       "      | 224\n",
       " | 4\n",
       " | 18\n",
       " | 2\n",
       " | 
\n",
       "    \n",
       "      | 225\n",
       " | 5\n",
       " | 18\n",
       " | 2\n",
       " | 
\n",
       "    \n",
       "      | 226\n",
       " | 6\n",
       " | 18\n",
       " | 0\n",
       " | 
\n",
       "    \n",
       "      | 227\n",
       " | 7\n",
       " | 18\n",
       " | 0\n",
       " | 
\n",
       "    \n",
       "      | 228\n",
       " | 8\n",
       " | 18\n",
       " | 0\n",
       " | 
\n",
       "    \n",
       "      | 229\n",
       " | 9\n",
       " | 18\n",
       " | 0\n",
       " | 
\n",
       "    \n",
       "      | 230\n",
       " | 10\n",
       " | 18\n",
       " | 0\n",
       " | 
\n",
       "    \n",
       "      | 231\n",
       " | 11\n",
       " | 18\n",
       " | 0\n",
       " | 
\n",
       "    \n",
       "      | 232\n",
       " | 12\n",
       " | 18\n",
       " | 0\n",
       " | 
\n",
       "    \n",
       "      | 233\n",
       " | 13\n",
       " | 18\n",
       " | 0\n",
       " | 
\n",
       "  \n",
       "
\n",
       "
221 rows × 3 columns
\n",
       "
\n",
       "\n",
       "
\n",
       "  \n",
       "    \n",
       "      | \n",
       " | betweenness\n",
       " | eid\n",
       " | eig_cent\n",
       " | indegree\n",
       " | title\n",
       " | source_title\n",
       " | 
\n",
       "  \n",
       "  \n",
       "    \n",
       "      | 2275\n",
       " | 6393.560498\n",
       " | 2-s2.0-71149088987\n",
       " | 1.000000e+00\n",
       " | 1876\n",
       " | Users of the world, unite! The challenges and ...\n",
       " | Business Horizons\n",
       " | 
\n",
       "    \n",
       "      | 179\n",
       " | 0.000000\n",
       " | 2-s2.0-43449135033\n",
       " | 6.899762e-15\n",
       " | 645\n",
       " | Why we twitter: Understanding microblogging us...\n",
       " | Joint Ninth WebKDD and First SNA-KDD 2007 Work...\n",
       " | 
\n",
       "    \n",
       "      | 5120\n",
       " | 669.625397\n",
       " | 2-s2.0-79953711711\n",
       " | 7.271520e-02\n",
       " | 468\n",
       " | Social media? Get serious! Understanding the f...\n",
       " | Business Horizons\n",
       " | 
\n",
       "    \n",
       "      | 1855\n",
       " | 0.000000\n",
       " | 2-s2.0-67349268124\n",
       " | 2.974873e-01\n",
       " | 450\n",
       " | Social media: The new hybrid element of the pr...\n",
       " | Business Horizons\n",
       " | 
\n",
       "  \n",
       "
\n",
       "
\n",
       "\n",
       "
\n",
       "  \n",
       "    \n",
       "      | \n",
       " | betweenness\n",
       " | eid\n",
       " | eig_cent\n",
       " | indegree\n",
       " | title\n",
       " | source_title\n",
       " | 
\n",
       "  \n",
       "  \n",
       "    \n",
       "      | 2275\n",
       " | 6393.560498\n",
       " | 2-s2.0-71149088987\n",
       " | 1.000000\n",
       " | 1876\n",
       " | Users of the world, unite! The challenges and ...\n",
       " | Business Horizons\n",
       " | 
\n",
       "    \n",
       "      | 2259\n",
       " | 0.000000\n",
       " | 2-s2.0-70349816888\n",
       " | 0.605279\n",
       " | 70\n",
       " | The fairyland of Second Life: Virtual social w...\n",
       " | Business Horizons\n",
       " | 
\n",
       "    \n",
       "      | 3612\n",
       " | 0.000000\n",
       " | 2-s2.0-77949522596\n",
       " | 0.563979\n",
       " | 335\n",
       " | Networked narratives: Understanding word-of-mo...\n",
       " | Journal of Marketing\n",
       " | 
\n",
       "    \n",
       "      | 7088\n",
       " | 0.000000\n",
       " | 2-s2.0-79551582037\n",
       " | 0.432951\n",
       " | 36\n",
       " | Online Personal Branding: Processes, Challenge...\n",
       " | Journal of Interactive Marketing\n",
       " | 
\n",
       "  \n",
       "
\n",
       "
\n",
       "\n",
       "
\n",
       "  \n",
       "    \n",
       "      | \n",
       " | betweenness\n",
       " | eid\n",
       " | eig_cent\n",
       " | indegree\n",
       " | title\n",
       " | source_title\n",
       " | 
\n",
       "  \n",
       "  \n",
       "    \n",
       "      | 2275\n",
       " | 6393.560498\n",
       " | 2-s2.0-71149088987\n",
       " | 1.000000e+00\n",
       " | 1876\n",
       " | Users of the world, unite! The challenges and ...\n",
       " | Business Horizons\n",
       " | 
\n",
       "    \n",
       "      | 401\n",
       " | 6220.250000\n",
       " | 2-s2.0-70350491889\n",
       " | 3.749870e-16\n",
       " | 103\n",
       " | Crisis in a networked world: Features of compu...\n",
       " | Social Science Computer Review\n",
       " | 
\n",
       "    \n",
       "      | 2781\n",
       " | 5131.824639\n",
       " | 2-s2.0-84888047300\n",
       " | 1.310283e-01\n",
       " | 31\n",
       " | Social media metrics - A framework and guideli...\n",
       " | Journal of Interactive Marketing\n",
       " | 
\n",
       "    \n",
       "      | 3821\n",
       " | 4319.747561\n",
       " | 2-s2.0-84910136235\n",
       " | 3.045168e-18\n",
       " | 8\n",
       " | What are health-related users tweeting? A qual...\n",
       " | Journal of Medical Internet Research\n",
       " | 
\n",
       "  \n",
       "
\n",
       "
\n",
       "\n",
       "
\n",
       "  \n",
       "    \n",
       "      | \n",
       " | eid\n",
       " | cluster\n",
       " | 
\n",
       "  \n",
       "  \n",
       "    \n",
       "      | 0\n",
       " | 2-s2.0-71149088987\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 1\n",
       " | 2-s2.0-70349816888\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 2\n",
       " | 2-s2.0-79953711711\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 3\n",
       " | 2-s2.0-79551630751\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 4\n",
       " | 2-s2.0-80051469103\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 5\n",
       " | 2-s2.0-84866718851\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 6\n",
       " | 2-s2.0-84877685551\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 7\n",
       " | 2-s2.0-84864442547\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 8\n",
       " | 2-s2.0-84861420864\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 9\n",
       " | 2-s2.0-84887483487\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 10\n",
       " | 2-s2.0-80955144847\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 11\n",
       " | 2-s2.0-84885038309\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 12\n",
       " | 2-s2.0-84886099569\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 13\n",
       " | 2-s2.0-84863379783\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 14\n",
       " | 2-s2.0-84899093663\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 15\n",
       " | 2-s2.0-84879109859\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 16\n",
       " | 2-s2.0-83055168309\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 17\n",
       " | 2-s2.0-84876304322\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 18\n",
       " | 2-s2.0-84866168147\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 19\n",
       " | 2-s2.0-84877817428\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 20\n",
       " | 2-s2.0-84873481256\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 21\n",
       " | 2-s2.0-84861794897\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 22\n",
       " | 2-s2.0-84899508298\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 23\n",
       " | 2-s2.0-84898082465\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 24\n",
       " | 2-s2.0-84879021774\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 25\n",
       " | 2-s2.0-80054988041\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 26\n",
       " | 2-s2.0-84944394118\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 27\n",
       " | 2-s2.0-84870572301\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 28\n",
       " | 2-s2.0-84907167320\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | 29\n",
       " | 2-s2.0-84914675721\n",
       " | 1\n",
       " | 
\n",
       "    \n",
       "      | ...\n",
       " | ...\n",
       " | ...\n",
       " | 
\n",
       "    \n",
       "      | 6110\n",
       " | 2-s2.0-84856086839\n",
       " | 12\n",
       " | 
\n",
       "    \n",
       "      | 6111\n",
       " | 2-s2.0-84859510122\n",
       " | 12\n",
       " | 
\n",
       "    \n",
       "      | 6112\n",
       " | 2-s2.0-84905121209\n",
       " | 12\n",
       " | 
\n",
       "    \n",
       "      | 6113\n",
       " | 2-s2.0-84883758613\n",
       " | 12\n",
       " | 
\n",
       "    \n",
       "      | 6114\n",
       " | 2-s2.0-84877953100\n",
       " | 12\n",
       " | 
\n",
       "    \n",
       "      | 6115\n",
       " | 2-s2.0-84904376766\n",
       " | 12\n",
       " | 
\n",
       "    \n",
       "      | 6116\n",
       " | 2-s2.0-84905837182\n",
       " | 12\n",
       " | 
\n",
       "    \n",
       "      | 6117\n",
       " | 2-s2.0-84900461218\n",
       " | 12\n",
       " | 
\n",
       "    \n",
       "      | 6118\n",
       " | 2-s2.0-83755228785\n",
       " | 13\n",
       " | 
\n",
       "    \n",
       "      | 6119\n",
       " | 2-s2.0-84886795975\n",
       " | 13\n",
       " | 
\n",
       "    \n",
       "      | 6120\n",
       " | 2-s2.0-84876132785\n",
       " | 13\n",
       " | 
\n",
       "    \n",
       "      | 6121\n",
       " | 2-s2.0-84903121334\n",
       " | 13\n",
       " | 
\n",
       "    \n",
       "      | 6122\n",
       " | 2-s2.0-84863720400\n",
       " | 13\n",
       " | 
\n",
       "    \n",
       "      | 6123\n",
       " | 2-s2.0-84873180938\n",
       " | 13\n",
       " | 
\n",
       "    \n",
       "      | 6124\n",
       " | 2-s2.0-84914112838\n",
       " | 13\n",
       " | 
\n",
       "    \n",
       "      | 6125\n",
       " | 2-s2.0-84878795748\n",
       " | 13\n",
       " | 
\n",
       "    \n",
       "      | 6126\n",
       " | 2-s2.0-84888011666\n",
       " | 13\n",
       " | 
\n",
       "    \n",
       "      | 6127\n",
       " | 2-s2.0-84942101218\n",
       " | 13\n",
       " | 
\n",
       "    \n",
       "      | 6128\n",
       " | 2-s2.0-80052752113\n",
       " | 14\n",
       " | 
\n",
       "    \n",
       "      | 6129\n",
       " | 2-s2.0-84874074707\n",
       " | 14\n",
       " | 
\n",
       "    \n",
       "      | 6130\n",
       " | 2-s2.0-84942582235\n",
       " | 14\n",
       " | 
\n",
       "    \n",
       "      | 6131\n",
       " | 2-s2.0-70849130360\n",
       " | 14\n",
       " | 
\n",
       "    \n",
       "      | 6132\n",
       " | 2-s2.0-84864152630\n",
       " | 14\n",
       " | 
\n",
       "    \n",
       "      | 6133\n",
       " | 2-s2.0-84868709161\n",
       " | 15\n",
       " | 
\n",
       "    \n",
       "      | 6134\n",
       " | 2-s2.0-84896350015\n",
       " | 15\n",
       " | 
\n",
       "    \n",
       "      | 6135\n",
       " | 2-s2.0-84944104933\n",
       " | 15\n",
       " | 
\n",
       "    \n",
       "      | 6136\n",
       " | 2-s2.0-84875539506\n",
       " | 16\n",
       " | 
\n",
       "    \n",
       "      | 6137\n",
       " | 2-s2.0-84902262954\n",
       " | 16\n",
       " | 
\n",
       "    \n",
       "      | 6138\n",
       " | 2-s2.0-84909954481\n",
       " | 17\n",
       " | 
\n",
       "    \n",
       "      | 6139\n",
       " | 2-s2.0-84921469678\n",
       " | 18\n",
       " | 
\n",
       "  \n",
       "
\n",
       "
6140 rows × 2 columns
\n",
       "