Network-analysis

Labelling Output

Identifying Influencer, Experts and Broker within the Network Structure of Twitter

import networkx as nx
import pylab as plt
import pandas as pd
from collections import defaultdict
g = nx.read_edgelist("C:/Users/laris/Desktop/PROJECT-WM/output.txt", delimiter=",", create_using=nx.DiGraph(), nodetype=int)
#udg = nx.Graph(g)
def dict_sort(cent_dict, pos):
    # Create ordered tuple of centrality data
    cent_items=[(b,a) for (a,b) in cent_dict.items()]
    # Sort in descending order
    cent_items.sort()
    cent_items.reverse()
    return…

Identifying Experts

Finding Experts in the Structure of the Twitter7 Following/Follower Network

import networkx as nx
import pylab as plt
import math

EXPERT below

g = nx.read_edgelist("C:\\Users\\laris\\Desktop\\www_twitter7_results\\reply.txt", create_using=nx.DiGraph())
def dict_sort(cent_dict, pos):
    # Create ordered tuple of centrality data
    cent_items=[(b,a) for (a,b) in cent_dict.items()]
    # Sort in descending order
    cent_items.sort()
    cent_items.reverse()
    return tuple(reversed(cent_items[0:pos]))
#nx.draw(g)
#nx.is_connected(g)…