In [1]:
import sys
sys.path.append('../../code/')
import os
import json
from datetime import datetime
import time
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import scipy.stats as stats
import igraph as ig
from load_data import load_citation_network_igraph, case_info
%load_ext autoreload
%autoreload 2
%matplotlib inline
data_dir = '../../data/'
court_name = 'scotus'
In [2]:
# this will be a little slow the first time you run it
G = load_citation_network_igraph(data_dir, court_name)
print 'loaded %s network with %d cases and %d edges' % (court_name, len(G.vs), len(G.es))
In [3]:
pr = G.pagerank()
In [3]:
cl = G.closeness()
In [7]:
plt.hist(cl, bins=np.linspace(0, max(cl), 100));
In [ ]: