Google Scholar Visualization

Credit: chengjun's scholarNetwork script

Visualize Justin Wolfers' Google Scholar network


In [1]:
%matplotlib inline
from scholarNetwork import scholarNetwork
import matplotlib.pyplot as plt
import networkx as nx

In [2]:
# Set the scholar
scholar = 'https://scholar.google.com/citations?user=x6fNSxcAAAAJ&hl=en&oi=ASCII'

In [3]:
# Number of nodes
nodes = 52

In [4]:
# Get the graph g
g = scholarNetwork.getGraph(scholar, nodes)


12
52
183
more than 52 people now, break

Plot the network


In [14]:
plt.figure(figsize = (26, 26))
pos = nx.spring_layout(g) 
nx.draw_networkx_labels(g, pos, font_color='k', font_size = 14)
nx.draw(g, pos, node_size = 20, edge_color = 'grey', width = 0.4, arrows = True)

plt.title("Justin Wolfers' Google Scholar Network", fontsize=40)
plt.xticks([])
plt.yticks([])
plt.show()


Plot the important network nodes


In [19]:
# Plot graph g with important nodes according to PageRank
def important(G):
    rank = nx.betweenness_centrality(G).items()
    r = [x[1] for x in rank]
    # Mean centrality m
    m = sum(r)/len(r)
    # Threshold t, keep only the nodes with 3 times the mean m
    t = m*3
    Gt = G.copy()
    for k, v in rank:
        if v < t:
            Gt.remove_node(k)
    return Gt

Gt = important(g)

In [24]:
plt.figure(figsize = (10, 8))
pos = nx.spring_layout(g)
# plot all the nodes and the edges
nx.draw_networkx_nodes(g, pos, node_color = 'b', alpha = 0.2, node_size = 8)
nx.draw_networkx_edges(g, pos, alpha = 0.1)

# plot the important nodes and their labels
nx.draw_networkx_nodes(Gt, pos, node_color = 'r', alpha = 0.4, node_size = 250)
nx.draw_networkx_labels(Gt, pos, font_size = 12 , font_color = 'b')

plt.title("Justin Wolfers' Google Scholar Network", fontsize=20)
plt.xticks([])
plt.yticks([])
plt.show()


Histogram of Degree Distribution


In [5]:
d = nx.degree(g)
plt.figure(figsize = (8, 5))
plt.hist(d.values())
plt.title("Degree Distribution", fontsize = 15)
plt.show()


Degrees of each node


In [6]:
degrees = g.degree()
for each in degrees.items():
    print 'Degrees of each node: ', each[0], '\t', each[1]
sum_of_edges = sum(degrees.values())
print '-------------------------------------------'
print 'Sum of edges: ', sum_of_edges


Degrees of each node:  Linli Xu 	1
Degrees of each node:  Michael Gelman 	1
Degrees of each node:  Marc Meredith 	1
Degrees of each node:  Betsey Stevenson 	2
Degrees of each node:  Vincent Nijs 	1
Degrees of each node:  Kenneth C Wilbur 	21
Degrees of each node:  Thomas M. Eisenbach 	1
Degrees of each node:  Zhenyu Yan 	1
Degrees of each node:  Justin Wolfers 	17
Degrees of each node:  Daniele Nosenzo 	1
Degrees of each node:  Daniel Kahneman 	1
Degrees of each node:  Yi Zhu 	7
Degrees of each node:  Robert Hall 	1
Degrees of each node:  Sergio Tufik 	1
Degrees of each node:  Andrea M. Buffa 	1
Degrees of each node:  Pradeep Chintagunta 	1
Degrees of each node:  Fabio Schiantarelli 	1
Degrees of each node:  Daniel Sacks 	1
Degrees of each node:  Jeffrey Carpenter 	1
Degrees of each node:  Richard Thaler 	1
Degrees of each node:  John Chalmers 	1
Degrees of each node:  Angelo Mele 	1
Degrees of each node:  Andrew Caplin 	1
Degrees of each node:  Daniel L. Greenwald 	1
Degrees of each node:  Eric Bradlow 	1
Degrees of each node:  John Van Reenen 	1
Degrees of each node:  Eric Verhoogen 	1
Degrees of each node:  Greg M. Allenby 	1
Degrees of each node:  Robin Greenwood 	1
Degrees of each node:  Florentino Felgueroso 	1
Degrees of each node:  Danny Yagan 	1
Degrees of each node:  Diane Del Guercio 	1
Degrees of each node:  Christopher Ré 	1
Degrees of each node:  Carles Boix 	1
Degrees of each node:  Phillip Swagel 	1
Degrees of each node:  Esteban Rossi-Hansberg 	1
Degrees of each node:  Gianmarco León 	1
Degrees of each node:  Michaela Draganska 	1
Degrees of each node:  Xiaowei Xu 	1
Degrees of each node:  Steven Huddart 	1
Degrees of each node:  luis serven 	1
Degrees of each node:  Samuel Kortum 	1
Degrees of each node:  Lasse Heje Pedersen 	1
Degrees of each node:  Vasco Cúrdia 	6
Degrees of each node:  Dean Karlan 	1
Degrees of each node:  David Weil 	2
Degrees of each node:  Christian Stoeckert 	1
Degrees of each node:  Timur Kuran 	1
Degrees of each node:  Maciej H. Kotowski 	1
Degrees of each node:  James J. Choi 	1
Degrees of each node:  Przemyslaw Jeziorski 	1
Degrees of each node:  Philip Lane 	3
Degrees of each node:  Usman Roshan 	1
Degrees of each node:  Robert C. Feenstra 	1
Degrees of each node:  Tobias Adrian 	1
Degrees of each node:  Stephen P. Zeldes 	12
Degrees of each node:  Andrew Abel 	1
Degrees of each node:  David THESMAR 	1
Degrees of each node:  Markus Brunnermeier 	23
Degrees of each node:  Pierluigi Balduzzi 	1
Degrees of each node:  Paul Heaton 	1
Degrees of each node:  Wouter Dessein 	1
Degrees of each node:  Sylvain Chassang 	4
Degrees of each node:  Colin DeYoung 	1
Degrees of each node:  Mitchell Hoffman 	7
Degrees of each node:  Abraham Wyner 	2
Degrees of each node:  W. Evan Johnson 	1
Degrees of each node:  Frederick Guy 	1
Degrees of each node:  Marco Del Negro 	1
Degrees of each node:  Gholson Lyon 	1
Degrees of each node:  Brigitte Madrian 	1
Degrees of each node:  Huiqi Qu 	1
Degrees of each node:  Hakon Hakonarson 	1
Degrees of each node:  Olivia S. Mitchell 	1
Degrees of each node:  Costas Meghir 	1
Degrees of each node:  Andrea Tambalotti 	1
Degrees of each node:  Cass Sunstein 	11
Degrees of each node:  Kathryn M. E. Dominguez 	1
Degrees of each node:  Andrew Leigh 	1
Degrees of each node:  Adam Rennhoff 	1
Degrees of each node:  Dan Silverman 	1
Degrees of each node:  Fernando Pérez Cervantes 	1
Degrees of each node:  Hyun Song Shin 	1
Degrees of each node:  Lawrence Lessig 	4
Degrees of each node:  Jonathan Parker 	1
Degrees of each node:  Ricardo Reis 	11
Degrees of each node:  Bo Cowgill 	14
Degrees of each node:  David Laibson 	1
Degrees of each node:  Jonathan Skinner 	1
Degrees of each node:  Luigi Pascali 	1
Degrees of each node:  Christian Zehnder 	1
Degrees of each node:  Kai Wang 	1
Degrees of each node:  Ignacio Palacios-Huerta 	1
Degrees of each node:  Shane Jensen 	7
Degrees of each node:  Boaz Barak 	1
Degrees of each node:  John Morgan 	1
Degrees of each node:  Joshua Rauh 	1
Degrees of each node:  Michael Cafarella 	1
Degrees of each node:  Yuriy Gorodnichenko 	1
Degrees of each node:  Z. John Daye 	1
Degrees of each node:  Karen Dynan 	1
Degrees of each node:  Stijn Van Nieuwerburgh 	3
Degrees of each node:  Robert Hahn 	1
Degrees of each node:  Erik Snowberg 	11
Degrees of each node:  Wenguang Sun 	1
Degrees of each node:  Laura Veldkamp 	1
Degrees of each node:  Gary Gorton 	1
Degrees of each node:  Mark Dean 	1
Degrees of each node:  Joshua W. Elliott 	1
Degrees of each node:  Michael Elsby 	1
Degrees of each node:  Jon Anderson 	1
Degrees of each node:  Joel Slemrod 	1
Degrees of each node:  John Ameriks 	2
Degrees of each node:  David Dillenberger 	1
Degrees of each node:  Stephen V. Burks 	14
Degrees of each node:  Mark Lemley 	1
Degrees of each node:  Jonathan Reuter 	5
Degrees of each node:  Dimitri Vayanos 	14
Degrees of each node:  Mingyu (Max) Joo 	6
Degrees of each node:  Lorenz Goette 	1
Degrees of each node:  Susanto Basu 	7
Degrees of each node:  PATRICK BOLTON 	1
Degrees of each node:  Benito Arruñada 	1
Degrees of each node:  Zhi Wei 	18
Degrees of each node:  Luis Rayo 	1
Degrees of each node:  Andrea Mattozzi 	1
Degrees of each node:  Erin Krupka 	1
Degrees of each node:  Luis Garicano 	23
Degrees of each node:  John Beshears 	1
Degrees of each node:  Robert Barsky 	3
Degrees of each node:  Andrea Prat 	1
Degrees of each node:  Rong Ge 	1
Degrees of each node:  Yiran Guo 	1
Degrees of each node:  Jon McAuliffe 	1
Degrees of each node:  Shijie Lu 	1
Degrees of each node:  Nick Bloom 	1
Degrees of each node:  Eric Zitzewitz 	9
Degrees of each node:  Pol Antras 	1
Degrees of each node:  Steven Tadelis 	1
Degrees of each node:  John Fernald 	2
Degrees of each node:  Stefan Nagel 	1
Degrees of each node:  David Schkade 	1
Degrees of each node:  Eric Posner 	2
Degrees of each node:  Martin Oehmke 	1
Degrees of each node:  Avinash Persaud 	1
Degrees of each node:  Mingyao Li 	1
Degrees of each node:  Robert Rooderkerk 	1
Degrees of each node:  David Weisbach 	8
Degrees of each node:  Carl Mela 	1
Degrees of each node:  Kfir Eliaz 	1
Degrees of each node:  Raffaella Sadun 	1
Degrees of each node:  Paul Resnick 	1
Degrees of each node:  Steven Berry 	1
Degrees of each node:  Arvind Krishnamurthy 	1
Degrees of each node:  Andrea Ferrero 	1
Degrees of each node:  Stephen H. Shore 	1
Degrees of each node:  Wei Wang 	1
Degrees of each node:  William Fuchs 	1
Degrees of each node:  N. Gregory Mankiw 	16
Degrees of each node:  Philippe Rigollet 	1
Degrees of each node:  Kristen Monaco 	1
Degrees of each node:  Valerie Ramey 	1
Degrees of each node:  Elizabeth Lyons 	1
Degrees of each node:  Michael H. Belzer 	1
Degrees of each node:  Neil Malhotra 	1
Degrees of each node:  Gilbert E. Metcalf 	1
Degrees of each node:  Matthew D. Shapiro 	21
Degrees of each node:  Pietro Ortoleva 	5
Degrees of each node:  Dolan Antenucci 	1
Degrees of each node:  Jonathan Zinman 	2
Degrees of each node:  Ahmed Khwaja 	1
Degrees of each node:  Pierre-Olivier Weill 	1
Degrees of each node:  Patrick Eichenberger 	1
Degrees of each node:  lawrence summers 	1
Degrees of each node:  Vicente Cuñat 	1
Degrees of each node:  Kusum L. Ailawadi 	1
Degrees of each node:  John Y. Campbell 	1
Degrees of each node:  Jura Liaukonyte 	1
Degrees of each node:  Peter Kondor 	1
Degrees of each node:  Tyler Shumway 	1
Degrees of each node:  Margaret Levenstein 	1
Degrees of each node:  Pingzhao Hu 	1
-------------------------------------------
Sum of edges:  470

Degree Centrality


In [7]:
centrality =  nx.degree_centrality(g)
for each in centrality.items():
    print 'Degree Centrality: ', each[0], '\t', each[1]


Degree Centrality:  Linli Xu 	0.00552486187845
Degree Centrality:  Michael Gelman 	0.00552486187845
Degree Centrality:  Marc Meredith 	0.00552486187845
Degree Centrality:  Betsey Stevenson 	0.0110497237569
Degree Centrality:  Vincent Nijs 	0.00552486187845
Degree Centrality:  Kenneth C Wilbur 	0.116022099448
Degree Centrality:  Thomas M. Eisenbach 	0.00552486187845
Degree Centrality:  Zhenyu Yan 	0.00552486187845
Degree Centrality:  Justin Wolfers 	0.0939226519337
Degree Centrality:  Daniele Nosenzo 	0.00552486187845
Degree Centrality:  Daniel Kahneman 	0.00552486187845
Degree Centrality:  Yi Zhu 	0.0386740331492
Degree Centrality:  Robert Hall 	0.00552486187845
Degree Centrality:  Sergio Tufik 	0.00552486187845
Degree Centrality:  Andrea M. Buffa 	0.00552486187845
Degree Centrality:  Pradeep Chintagunta 	0.00552486187845
Degree Centrality:  Fabio Schiantarelli 	0.00552486187845
Degree Centrality:  Daniel Sacks 	0.00552486187845
Degree Centrality:  Jeffrey Carpenter 	0.00552486187845
Degree Centrality:  Richard Thaler 	0.00552486187845
Degree Centrality:  John Chalmers 	0.00552486187845
Degree Centrality:  Angelo Mele 	0.00552486187845
Degree Centrality:  Andrew Caplin 	0.00552486187845
Degree Centrality:  Daniel L. Greenwald 	0.00552486187845
Degree Centrality:  Eric Bradlow 	0.00552486187845
Degree Centrality:  John Van Reenen 	0.00552486187845
Degree Centrality:  Eric Verhoogen 	0.00552486187845
Degree Centrality:  Greg M. Allenby 	0.00552486187845
Degree Centrality:  Robin Greenwood 	0.00552486187845
Degree Centrality:  Florentino Felgueroso 	0.00552486187845
Degree Centrality:  Danny Yagan 	0.00552486187845
Degree Centrality:  Diane Del Guercio 	0.00552486187845
Degree Centrality:  Christopher Ré 	0.00552486187845
Degree Centrality:  Carles Boix 	0.00552486187845
Degree Centrality:  Phillip Swagel 	0.00552486187845
Degree Centrality:  Esteban Rossi-Hansberg 	0.00552486187845
Degree Centrality:  Gianmarco León 	0.00552486187845
Degree Centrality:  Michaela Draganska 	0.00552486187845
Degree Centrality:  Xiaowei Xu 	0.00552486187845
Degree Centrality:  Steven Huddart 	0.00552486187845
Degree Centrality:  luis serven 	0.00552486187845
Degree Centrality:  Samuel Kortum 	0.00552486187845
Degree Centrality:  Lasse Heje Pedersen 	0.00552486187845
Degree Centrality:  Vasco Cúrdia 	0.0331491712707
Degree Centrality:  Dean Karlan 	0.00552486187845
Degree Centrality:  David Weil 	0.0110497237569
Degree Centrality:  Christian Stoeckert 	0.00552486187845
Degree Centrality:  Timur Kuran 	0.00552486187845
Degree Centrality:  Maciej H. Kotowski 	0.00552486187845
Degree Centrality:  James J. Choi 	0.00552486187845
Degree Centrality:  Przemyslaw Jeziorski 	0.00552486187845
Degree Centrality:  Philip Lane 	0.0165745856354
Degree Centrality:  Usman Roshan 	0.00552486187845
Degree Centrality:  Robert C. Feenstra 	0.00552486187845
Degree Centrality:  Tobias Adrian 	0.00552486187845
Degree Centrality:  Stephen P. Zeldes 	0.0662983425414
Degree Centrality:  Andrew Abel 	0.00552486187845
Degree Centrality:  David THESMAR 	0.00552486187845
Degree Centrality:  Markus Brunnermeier 	0.127071823204
Degree Centrality:  Pierluigi Balduzzi 	0.00552486187845
Degree Centrality:  Paul Heaton 	0.00552486187845
Degree Centrality:  Wouter Dessein 	0.00552486187845
Degree Centrality:  Sylvain Chassang 	0.0220994475138
Degree Centrality:  Colin DeYoung 	0.00552486187845
Degree Centrality:  Mitchell Hoffman 	0.0386740331492
Degree Centrality:  Abraham Wyner 	0.0110497237569
Degree Centrality:  W. Evan Johnson 	0.00552486187845
Degree Centrality:  Frederick Guy 	0.00552486187845
Degree Centrality:  Marco Del Negro 	0.00552486187845
Degree Centrality:  Gholson Lyon 	0.00552486187845
Degree Centrality:  Brigitte Madrian 	0.00552486187845
Degree Centrality:  Huiqi Qu 	0.00552486187845
Degree Centrality:  Hakon Hakonarson 	0.00552486187845
Degree Centrality:  Olivia S. Mitchell 	0.00552486187845
Degree Centrality:  Costas Meghir 	0.00552486187845
Degree Centrality:  Andrea Tambalotti 	0.00552486187845
Degree Centrality:  Cass Sunstein 	0.060773480663
Degree Centrality:  Kathryn M. E. Dominguez 	0.00552486187845
Degree Centrality:  Andrew Leigh 	0.00552486187845
Degree Centrality:  Adam Rennhoff 	0.00552486187845
Degree Centrality:  Dan Silverman 	0.00552486187845
Degree Centrality:  Fernando Pérez Cervantes 	0.00552486187845
Degree Centrality:  Hyun Song Shin 	0.00552486187845
Degree Centrality:  Lawrence Lessig 	0.0220994475138
Degree Centrality:  Jonathan Parker 	0.00552486187845
Degree Centrality:  Ricardo Reis 	0.060773480663
Degree Centrality:  Bo Cowgill 	0.0773480662983
Degree Centrality:  David Laibson 	0.00552486187845
Degree Centrality:  Jonathan Skinner 	0.00552486187845
Degree Centrality:  Luigi Pascali 	0.00552486187845
Degree Centrality:  Christian Zehnder 	0.00552486187845
Degree Centrality:  Kai Wang 	0.00552486187845
Degree Centrality:  Ignacio Palacios-Huerta 	0.00552486187845
Degree Centrality:  Shane Jensen 	0.0386740331492
Degree Centrality:  Boaz Barak 	0.00552486187845
Degree Centrality:  John Morgan 	0.00552486187845
Degree Centrality:  Joshua Rauh 	0.00552486187845
Degree Centrality:  Michael Cafarella 	0.00552486187845
Degree Centrality:  Yuriy Gorodnichenko 	0.00552486187845
Degree Centrality:  Z. John Daye 	0.00552486187845
Degree Centrality:  Karen Dynan 	0.00552486187845
Degree Centrality:  Stijn Van Nieuwerburgh 	0.0165745856354
Degree Centrality:  Robert Hahn 	0.00552486187845
Degree Centrality:  Erik Snowberg 	0.060773480663
Degree Centrality:  Wenguang Sun 	0.00552486187845
Degree Centrality:  Laura Veldkamp 	0.00552486187845
Degree Centrality:  Gary Gorton 	0.00552486187845
Degree Centrality:  Mark Dean 	0.00552486187845
Degree Centrality:  Joshua W. Elliott 	0.00552486187845
Degree Centrality:  Michael Elsby 	0.00552486187845
Degree Centrality:  Jon Anderson 	0.00552486187845
Degree Centrality:  Joel Slemrod 	0.00552486187845
Degree Centrality:  John Ameriks 	0.0110497237569
Degree Centrality:  David Dillenberger 	0.00552486187845
Degree Centrality:  Stephen V. Burks 	0.0773480662983
Degree Centrality:  Mark Lemley 	0.00552486187845
Degree Centrality:  Jonathan Reuter 	0.0276243093923
Degree Centrality:  Dimitri Vayanos 	0.0773480662983
Degree Centrality:  Mingyu (Max) Joo 	0.0331491712707
Degree Centrality:  Lorenz Goette 	0.00552486187845
Degree Centrality:  Susanto Basu 	0.0386740331492
Degree Centrality:  PATRICK BOLTON 	0.00552486187845
Degree Centrality:  Benito Arruñada 	0.00552486187845
Degree Centrality:  Zhi Wei 	0.0994475138122
Degree Centrality:  Luis Rayo 	0.00552486187845
Degree Centrality:  Andrea Mattozzi 	0.00552486187845
Degree Centrality:  Erin Krupka 	0.00552486187845
Degree Centrality:  Luis Garicano 	0.127071823204
Degree Centrality:  John Beshears 	0.00552486187845
Degree Centrality:  Robert Barsky 	0.0165745856354
Degree Centrality:  Andrea Prat 	0.00552486187845
Degree Centrality:  Rong Ge 	0.00552486187845
Degree Centrality:  Yiran Guo 	0.00552486187845
Degree Centrality:  Jon McAuliffe 	0.00552486187845
Degree Centrality:  Shijie Lu 	0.00552486187845
Degree Centrality:  Nick Bloom 	0.00552486187845
Degree Centrality:  Eric Zitzewitz 	0.0497237569061
Degree Centrality:  Pol Antras 	0.00552486187845
Degree Centrality:  Steven Tadelis 	0.00552486187845
Degree Centrality:  John Fernald 	0.0110497237569
Degree Centrality:  Stefan Nagel 	0.00552486187845
Degree Centrality:  David Schkade 	0.00552486187845
Degree Centrality:  Eric Posner 	0.0110497237569
Degree Centrality:  Martin Oehmke 	0.00552486187845
Degree Centrality:  Avinash Persaud 	0.00552486187845
Degree Centrality:  Mingyao Li 	0.00552486187845
Degree Centrality:  Robert Rooderkerk 	0.00552486187845
Degree Centrality:  David Weisbach 	0.0441988950276
Degree Centrality:  Carl Mela 	0.00552486187845
Degree Centrality:  Kfir Eliaz 	0.00552486187845
Degree Centrality:  Raffaella Sadun 	0.00552486187845
Degree Centrality:  Paul Resnick 	0.00552486187845
Degree Centrality:  Steven Berry 	0.00552486187845
Degree Centrality:  Arvind Krishnamurthy 	0.00552486187845
Degree Centrality:  Andrea Ferrero 	0.00552486187845
Degree Centrality:  Stephen H. Shore 	0.00552486187845
Degree Centrality:  Wei Wang 	0.00552486187845
Degree Centrality:  William Fuchs 	0.00552486187845
Degree Centrality:  N. Gregory Mankiw 	0.0883977900552
Degree Centrality:  Philippe Rigollet 	0.00552486187845
Degree Centrality:  Kristen Monaco 	0.00552486187845
Degree Centrality:  Valerie Ramey 	0.00552486187845
Degree Centrality:  Elizabeth Lyons 	0.00552486187845
Degree Centrality:  Michael H. Belzer 	0.00552486187845
Degree Centrality:  Neil Malhotra 	0.00552486187845
Degree Centrality:  Gilbert E. Metcalf 	0.00552486187845
Degree Centrality:  Matthew D. Shapiro 	0.116022099448
Degree Centrality:  Pietro Ortoleva 	0.0276243093923
Degree Centrality:  Dolan Antenucci 	0.00552486187845
Degree Centrality:  Jonathan Zinman 	0.0110497237569
Degree Centrality:  Ahmed Khwaja 	0.00552486187845
Degree Centrality:  Pierre-Olivier Weill 	0.00552486187845
Degree Centrality:  Patrick Eichenberger 	0.00552486187845
Degree Centrality:  lawrence summers 	0.00552486187845
Degree Centrality:  Vicente Cuñat 	0.00552486187845
Degree Centrality:  Kusum L. Ailawadi 	0.00552486187845
Degree Centrality:  John Y. Campbell 	0.00552486187845
Degree Centrality:  Jura Liaukonyte 	0.00552486187845
Degree Centrality:  Peter Kondor 	0.00552486187845
Degree Centrality:  Tyler Shumway 	0.00552486187845
Degree Centrality:  Margaret Levenstein 	0.00552486187845
Degree Centrality:  Pingzhao Hu 	0.00552486187845

In [9]:
avg_centrality =  sum(centrality.values())/len(centrality)
print 'Avergage Degree Centrality: ', avg_centrality


Avergage Degree Centrality:  0.0142675004553

In [14]:
plt.figure(figsize = (8, 5))
plt.hist(centrality.values())
plt.title("Degree Centrality Distribution", fontsize = 15)
plt.show()


Closeness Centrality


In [10]:
close = nx.closeness_centrality(g)    
for each in close.items():
    print 'Closeness Centrality: ', each[0], '\t', each[1]


Closeness Centrality:  Linli Xu 	0.0
Closeness Centrality:  Michael Gelman 	0.0
Closeness Centrality:  Marc Meredith 	0.0
Closeness Centrality:  Betsey Stevenson 	0.273413897281
Closeness Centrality:  Vincent Nijs 	0.0
Closeness Centrality:  Kenneth C Wilbur 	0.24659400545
Closeness Centrality:  Thomas M. Eisenbach 	0.0
Closeness Centrality:  Zhenyu Yan 	0.0
Closeness Centrality:  Justin Wolfers 	0.375518672199
Closeness Centrality:  Daniele Nosenzo 	0.0
Closeness Centrality:  Daniel Kahneman 	0.0
Closeness Centrality:  Yi Zhu 	0.241978609626
Closeness Centrality:  Robert Hall 	0.0
Closeness Centrality:  Sergio Tufik 	0.0
Closeness Centrality:  Andrea M. Buffa 	0.0
Closeness Centrality:  Pradeep Chintagunta 	0.0
Closeness Centrality:  Fabio Schiantarelli 	0.0
Closeness Centrality:  Daniel Sacks 	0.0
Closeness Centrality:  Jeffrey Carpenter 	0.0
Closeness Centrality:  Richard Thaler 	0.0
Closeness Centrality:  John Chalmers 	0.0
Closeness Centrality:  Angelo Mele 	0.0
Closeness Centrality:  Andrew Caplin 	0.0
Closeness Centrality:  Daniel L. Greenwald 	0.0
Closeness Centrality:  Eric Bradlow 	0.0
Closeness Centrality:  John Van Reenen 	0.0
Closeness Centrality:  Eric Verhoogen 	0.0
Closeness Centrality:  Greg M. Allenby 	0.0
Closeness Centrality:  Robin Greenwood 	0.0
Closeness Centrality:  Florentino Felgueroso 	0.0
Closeness Centrality:  Danny Yagan 	0.0
Closeness Centrality:  Diane Del Guercio 	0.0
Closeness Centrality:  Christopher Ré 	0.0
Closeness Centrality:  Carles Boix 	0.0
Closeness Centrality:  Phillip Swagel 	0.0
Closeness Centrality:  Esteban Rossi-Hansberg 	0.0
Closeness Centrality:  Gianmarco León 	0.0
Closeness Centrality:  Michaela Draganska 	0.0
Closeness Centrality:  Xiaowei Xu 	0.0
Closeness Centrality:  Steven Huddart 	0.0
Closeness Centrality:  luis serven 	0.0
Closeness Centrality:  Samuel Kortum 	0.0
Closeness Centrality:  Lasse Heje Pedersen 	0.0
Closeness Centrality:  Vasco Cúrdia 	0.243935309973
Closeness Centrality:  Dean Karlan 	0.0
Closeness Centrality:  David Weil 	0.0
Closeness Centrality:  Christian Stoeckert 	0.0
Closeness Centrality:  Timur Kuran 	0.0
Closeness Centrality:  Maciej H. Kotowski 	0.0
Closeness Centrality:  James J. Choi 	0.0
Closeness Centrality:  Przemyslaw Jeziorski 	0.0
Closeness Centrality:  Philip Lane 	0.0
Closeness Centrality:  Usman Roshan 	0.0
Closeness Centrality:  Robert C. Feenstra 	0.0
Closeness Centrality:  Tobias Adrian 	0.0
Closeness Centrality:  Stephen P. Zeldes 	0.259312320917
Closeness Centrality:  Andrew Abel 	0.0
Closeness Centrality:  David THESMAR 	0.0
Closeness Centrality:  Markus Brunnermeier 	0.261183261183
Closeness Centrality:  Pierluigi Balduzzi 	0.0
Closeness Centrality:  Paul Heaton 	0.0
Closeness Centrality:  Wouter Dessein 	0.0
Closeness Centrality:  Sylvain Chassang 	0.223181257707
Closeness Centrality:  Colin DeYoung 	0.0
Closeness Centrality:  Mitchell Hoffman 	0.241333333333
Closeness Centrality:  Abraham Wyner 	0.0
Closeness Centrality:  W. Evan Johnson 	0.0
Closeness Centrality:  Frederick Guy 	0.0
Closeness Centrality:  Marco Del Negro 	0.0
Closeness Centrality:  Gholson Lyon 	0.0
Closeness Centrality:  Brigitte Madrian 	0.0
Closeness Centrality:  Huiqi Qu 	0.0
Closeness Centrality:  Hakon Hakonarson 	0.0
Closeness Centrality:  Olivia S. Mitchell 	0.0
Closeness Centrality:  Costas Meghir 	0.0
Closeness Centrality:  Andrea Tambalotti 	0.0
Closeness Centrality:  Cass Sunstein 	0.0565042692115
Closeness Centrality:  Kathryn M. E. Dominguez 	0.0
Closeness Centrality:  Andrew Leigh 	0.0
Closeness Centrality:  Adam Rennhoff 	0.0
Closeness Centrality:  Dan Silverman 	0.0
Closeness Centrality:  Fernando Pérez Cervantes 	0.0
Closeness Centrality:  Hyun Song Shin 	0.0
Closeness Centrality:  Lawrence Lessig 	0.0388466850829
Closeness Centrality:  Jonathan Parker 	0.0
Closeness Centrality:  Ricardo Reis 	0.317543859649
Closeness Centrality:  Bo Cowgill 	0.308347529813
Closeness Centrality:  David Laibson 	0.0
Closeness Centrality:  Jonathan Skinner 	0.0
Closeness Centrality:  Luigi Pascali 	0.0
Closeness Centrality:  Christian Zehnder 	0.0
Closeness Centrality:  Kai Wang 	0.0
Closeness Centrality:  Ignacio Palacios-Huerta 	0.0
Closeness Centrality:  Shane Jensen 	0.0658503807675
Closeness Centrality:  Boaz Barak 	0.0
Closeness Centrality:  John Morgan 	0.0
Closeness Centrality:  Joshua Rauh 	0.0
Closeness Centrality:  Michael Cafarella 	0.0
Closeness Centrality:  Yuriy Gorodnichenko 	0.0
Closeness Centrality:  Z. John Daye 	0.0
Closeness Centrality:  Karen Dynan 	0.0
Closeness Centrality:  Stijn Van Nieuwerburgh 	0.0
Closeness Centrality:  Robert Hahn 	0.0
Closeness Centrality:  Erik Snowberg 	0.285039370079
Closeness Centrality:  Wenguang Sun 	0.0
Closeness Centrality:  Laura Veldkamp 	0.0
Closeness Centrality:  Gary Gorton 	0.0
Closeness Centrality:  Mark Dean 	0.0
Closeness Centrality:  Joshua W. Elliott 	0.0
Closeness Centrality:  Michael Elsby 	0.0
Closeness Centrality:  Jon Anderson 	0.0
Closeness Centrality:  Joel Slemrod 	0.0
Closeness Centrality:  John Ameriks 	0.0
Closeness Centrality:  David Dillenberger 	0.0
Closeness Centrality:  Stephen V. Burks 	0.243606998654
Closeness Centrality:  Mark Lemley 	0.0
Closeness Centrality:  Jonathan Reuter 	0.23264781491
Closeness Centrality:  Dimitri Vayanos 	0.257834757835
Closeness Centrality:  Mingyu (Max) Joo 	0.241655540721
Closeness Centrality:  Lorenz Goette 	0.0
Closeness Centrality:  Susanto Basu 	0.0276243093923
Closeness Centrality:  PATRICK BOLTON 	0.0
Closeness Centrality:  Benito Arruñada 	0.0
Closeness Centrality:  Zhi Wei 	0.0974585635359
Closeness Centrality:  Luis Rayo 	0.0
Closeness Centrality:  Andrea Mattozzi 	0.0
Closeness Centrality:  Erin Krupka 	0.0
Closeness Centrality:  Luis Garicano 	0.261183261183
Closeness Centrality:  John Beshears 	0.0
Closeness Centrality:  Robert Barsky 	0.0
Closeness Centrality:  Andrea Prat 	0.0
Closeness Centrality:  Rong Ge 	0.0
Closeness Centrality:  Yiran Guo 	0.0
Closeness Centrality:  Jon McAuliffe 	0.0
Closeness Centrality:  Shijie Lu 	0.0
Closeness Centrality:  Nick Bloom 	0.0
Closeness Centrality:  Eric Zitzewitz 	0.299668874172
Closeness Centrality:  Pol Antras 	0.0
Closeness Centrality:  Steven Tadelis 	0.0
Closeness Centrality:  John Fernald 	0.0
Closeness Centrality:  Stefan Nagel 	0.0
Closeness Centrality:  David Schkade 	0.0
Closeness Centrality:  Eric Posner 	0.0
Closeness Centrality:  Martin Oehmke 	0.0
Closeness Centrality:  Avinash Persaud 	0.0
Closeness Centrality:  Mingyao Li 	0.0
Closeness Centrality:  Robert Rooderkerk 	0.0
Closeness Centrality:  David Weisbach 	0.0497237569061
Closeness Centrality:  Carl Mela 	0.0
Closeness Centrality:  Kfir Eliaz 	0.0
Closeness Centrality:  Raffaella Sadun 	0.0
Closeness Centrality:  Paul Resnick 	0.0
Closeness Centrality:  Steven Berry 	0.0
Closeness Centrality:  Arvind Krishnamurthy 	0.0
Closeness Centrality:  Andrea Ferrero 	0.0
Closeness Centrality:  Stephen H. Shore 	0.0
Closeness Centrality:  Wei Wang 	0.0
Closeness Centrality:  William Fuchs 	0.0
Closeness Centrality:  N. Gregory Mankiw 	0.337057728119
Closeness Centrality:  Philippe Rigollet 	0.0
Closeness Centrality:  Kristen Monaco 	0.0
Closeness Centrality:  Valerie Ramey 	0.0
Closeness Centrality:  Elizabeth Lyons 	0.0
Closeness Centrality:  Michael H. Belzer 	0.0
Closeness Centrality:  Neil Malhotra 	0.0
Closeness Centrality:  Gilbert E. Metcalf 	0.0
Closeness Centrality:  Matthew D. Shapiro 	0.266961651917
Closeness Centrality:  Pietro Ortoleva 	0.223733003708
Closeness Centrality:  Dolan Antenucci 	0.0
Closeness Centrality:  Jonathan Zinman 	0.00552486187845
Closeness Centrality:  Ahmed Khwaja 	0.0
Closeness Centrality:  Pierre-Olivier Weill 	0.0
Closeness Centrality:  Patrick Eichenberger 	0.0
Closeness Centrality:  lawrence summers 	0.0
Closeness Centrality:  Vicente Cuñat 	0.0
Closeness Centrality:  Kusum L. Ailawadi 	0.0
Closeness Centrality:  John Y. Campbell 	0.0
Closeness Centrality:  Jura Liaukonyte 	0.0
Closeness Centrality:  Peter Kondor 	0.0
Closeness Centrality:  Tyler Shumway 	0.0
Closeness Centrality:  Margaret Levenstein 	0.0
Closeness Centrality:  Pingzhao Hu 	0.0

In [11]:
avg_closeness =  sum(close.values())/len(close)
print 'Avergage Closeness: ', avg_closeness


Avergage Closeness:  0.0328750762923

In [15]:
plt.figure(figsize = (8, 5))
plt.hist(close.values())
plt.title("Closeness Centrality Distribution", fontsize = 15)
plt.show()


Betweeness Centrality


In [12]:
btwn = nx.betweenness_centrality(g, weight='weight')
for each in btwn.items():
    print 'Betweeness Centrality: ', each[0], '\t', each[1]


Betweeness Centrality:  Linli Xu 	0.0
Betweeness Centrality:  Michael Gelman 	0.0
Betweeness Centrality:  Marc Meredith 	0.0
Betweeness Centrality:  Betsey Stevenson 	0.0
Betweeness Centrality:  Vincent Nijs 	0.0
Betweeness Centrality:  Kenneth C Wilbur 	0.00920810313076
Betweeness Centrality:  Thomas M. Eisenbach 	0.0
Betweeness Centrality:  Zhenyu Yan 	0.0
Betweeness Centrality:  Justin Wolfers 	0.0805862492327
Betweeness Centrality:  Daniele Nosenzo 	0.0
Betweeness Centrality:  Daniel Kahneman 	0.0
Betweeness Centrality:  Yi Zhu 	0.00061387354205
Betweeness Centrality:  Robert Hall 	0.0
Betweeness Centrality:  Sergio Tufik 	0.0
Betweeness Centrality:  Andrea M. Buffa 	0.0
Betweeness Centrality:  Pradeep Chintagunta 	0.0
Betweeness Centrality:  Fabio Schiantarelli 	0.0
Betweeness Centrality:  Daniel Sacks 	0.0
Betweeness Centrality:  Jeffrey Carpenter 	0.0
Betweeness Centrality:  Richard Thaler 	0.0
Betweeness Centrality:  John Chalmers 	0.0
Betweeness Centrality:  Angelo Mele 	0.0
Betweeness Centrality:  Andrew Caplin 	0.0
Betweeness Centrality:  Daniel L. Greenwald 	0.0
Betweeness Centrality:  Eric Bradlow 	0.0
Betweeness Centrality:  John Van Reenen 	0.0
Betweeness Centrality:  Eric Verhoogen 	0.0
Betweeness Centrality:  Greg M. Allenby 	0.0
Betweeness Centrality:  Robin Greenwood 	0.0
Betweeness Centrality:  Florentino Felgueroso 	0.0
Betweeness Centrality:  Danny Yagan 	0.0
Betweeness Centrality:  Diane Del Guercio 	0.0
Betweeness Centrality:  Christopher Ré 	0.0
Betweeness Centrality:  Carles Boix 	0.0
Betweeness Centrality:  Phillip Swagel 	0.0
Betweeness Centrality:  Esteban Rossi-Hansberg 	0.0
Betweeness Centrality:  Gianmarco León 	0.0
Betweeness Centrality:  Michaela Draganska 	0.0
Betweeness Centrality:  Xiaowei Xu 	0.0
Betweeness Centrality:  Steven Huddart 	0.0
Betweeness Centrality:  luis serven 	0.0
Betweeness Centrality:  Samuel Kortum 	0.0
Betweeness Centrality:  Lasse Heje Pedersen 	0.0
Betweeness Centrality:  Vasco Cúrdia 	0.0024554941682
Betweeness Centrality:  Dean Karlan 	0.0
Betweeness Centrality:  David Weil 	0.0
Betweeness Centrality:  Christian Stoeckert 	0.0
Betweeness Centrality:  Timur Kuran 	0.0
Betweeness Centrality:  Maciej H. Kotowski 	0.0
Betweeness Centrality:  James J. Choi 	0.0
Betweeness Centrality:  Przemyslaw Jeziorski 	0.0
Betweeness Centrality:  Philip Lane 	0.0
Betweeness Centrality:  Usman Roshan 	0.0
Betweeness Centrality:  Robert C. Feenstra 	0.0
Betweeness Centrality:  Tobias Adrian 	0.0
Betweeness Centrality:  Stephen P. Zeldes 	0.00520257826888
Betweeness Centrality:  Andrew Abel 	0.0
Betweeness Centrality:  David THESMAR 	0.0
Betweeness Centrality:  Markus Brunnermeier 	0.00957642725599
Betweeness Centrality:  Pierluigi Balduzzi 	0.0
Betweeness Centrality:  Paul Heaton 	0.0
Betweeness Centrality:  Wouter Dessein 	0.0
Betweeness Centrality:  Sylvain Chassang 	0.0012277470841
Betweeness Centrality:  Colin DeYoung 	0.0
Betweeness Centrality:  Mitchell Hoffman 	0.00184162062615
Betweeness Centrality:  Abraham Wyner 	0.0
Betweeness Centrality:  W. Evan Johnson 	0.0
Betweeness Centrality:  Frederick Guy 	0.0
Betweeness Centrality:  Marco Del Negro 	0.0
Betweeness Centrality:  Gholson Lyon 	0.0
Betweeness Centrality:  Brigitte Madrian 	0.0
Betweeness Centrality:  Huiqi Qu 	0.0
Betweeness Centrality:  Hakon Hakonarson 	0.0
Betweeness Centrality:  Olivia S. Mitchell 	0.0
Betweeness Centrality:  Costas Meghir 	0.0
Betweeness Centrality:  Andrea Tambalotti 	0.0
Betweeness Centrality:  Cass Sunstein 	0.0102823818293
Betweeness Centrality:  Kathryn M. E. Dominguez 	0.0
Betweeness Centrality:  Andrew Leigh 	0.0
Betweeness Centrality:  Adam Rennhoff 	0.0
Betweeness Centrality:  Dan Silverman 	0.0
Betweeness Centrality:  Fernando Pérez Cervantes 	0.0
Betweeness Centrality:  Hyun Song Shin 	0.0
Betweeness Centrality:  Lawrence Lessig 	0.00141190914672
Betweeness Centrality:  Jonathan Parker 	0.0
Betweeness Centrality:  Ricardo Reis 	0.0408839779006
Betweeness Centrality:  Bo Cowgill 	0.0407612031921
Betweeness Centrality:  David Laibson 	0.0
Betweeness Centrality:  Jonathan Skinner 	0.0
Betweeness Centrality:  Luigi Pascali 	0.0
Betweeness Centrality:  Christian Zehnder 	0.0
Betweeness Centrality:  Kai Wang 	0.0
Betweeness Centrality:  Ignacio Palacios-Huerta 	0.0
Betweeness Centrality:  Shane Jensen 	0.0130141190915
Betweeness Centrality:  Boaz Barak 	0.0
Betweeness Centrality:  John Morgan 	0.0
Betweeness Centrality:  Joshua Rauh 	0.0
Betweeness Centrality:  Michael Cafarella 	0.0
Betweeness Centrality:  Yuriy Gorodnichenko 	0.0
Betweeness Centrality:  Z. John Daye 	0.0
Betweeness Centrality:  Karen Dynan 	0.0
Betweeness Centrality:  Stijn Van Nieuwerburgh 	0.0
Betweeness Centrality:  Robert Hahn 	0.0
Betweeness Centrality:  Erik Snowberg 	0.0164211172498
Betweeness Centrality:  Wenguang Sun 	0.0
Betweeness Centrality:  Laura Veldkamp 	0.0
Betweeness Centrality:  Gary Gorton 	0.0
Betweeness Centrality:  Mark Dean 	0.0
Betweeness Centrality:  Joshua W. Elliott 	0.0
Betweeness Centrality:  Michael Elsby 	0.0
Betweeness Centrality:  Jon Anderson 	0.0
Betweeness Centrality:  Joel Slemrod 	0.0
Betweeness Centrality:  John Ameriks 	0.0
Betweeness Centrality:  David Dillenberger 	0.0
Betweeness Centrality:  Stephen V. Burks 	0.0061387354205
Betweeness Centrality:  Mark Lemley 	0.0
Betweeness Centrality:  Jonathan Reuter 	0.00184162062615
Betweeness Centrality:  Dimitri Vayanos 	0.00405156537753
Betweeness Centrality:  Mingyu (Max) Joo 	0.0
Betweeness Centrality:  Lorenz Goette 	0.0
Betweeness Centrality:  Susanto Basu 	0.00225598526703
Betweeness Centrality:  PATRICK BOLTON 	0.0
Betweeness Centrality:  Benito Arruñada 	0.0
Betweeness Centrality:  Zhi Wei 	0.0108041743401
Betweeness Centrality:  Luis Rayo 	0.0
Betweeness Centrality:  Andrea Mattozzi 	0.0
Betweeness Centrality:  Erin Krupka 	0.0
Betweeness Centrality:  Luis Garicano 	0.00957642725599
Betweeness Centrality:  John Beshears 	0.0
Betweeness Centrality:  Robert Barsky 	0.0
Betweeness Centrality:  Andrea Prat 	0.0
Betweeness Centrality:  Rong Ge 	0.0
Betweeness Centrality:  Yiran Guo 	0.0
Betweeness Centrality:  Jon McAuliffe 	0.0
Betweeness Centrality:  Shijie Lu 	0.0
Betweeness Centrality:  Nick Bloom 	0.0
Betweeness Centrality:  Eric Zitzewitz 	0.0115561694291
Betweeness Centrality:  Pol Antras 	0.0
Betweeness Centrality:  Steven Tadelis 	0.0
Betweeness Centrality:  John Fernald 	0.0
Betweeness Centrality:  Stefan Nagel 	0.0
Betweeness Centrality:  David Schkade 	0.0
Betweeness Centrality:  Eric Posner 	0.0
Betweeness Centrality:  Martin Oehmke 	0.0
Betweeness Centrality:  Avinash Persaud 	0.0
Betweeness Centrality:  Mingyao Li 	0.0
Betweeness Centrality:  Robert Rooderkerk 	0.0
Betweeness Centrality:  David Weisbach 	0.00352977286679
Betweeness Centrality:  Carl Mela 	0.0
Betweeness Centrality:  Kfir Eliaz 	0.0
Betweeness Centrality:  Raffaella Sadun 	0.0
Betweeness Centrality:  Paul Resnick 	0.0
Betweeness Centrality:  Steven Berry 	0.0
Betweeness Centrality:  Arvind Krishnamurthy 	0.0
Betweeness Centrality:  Andrea Ferrero 	0.0
Betweeness Centrality:  Stephen H. Shore 	0.0
Betweeness Centrality:  Wei Wang 	0.0
Betweeness Centrality:  William Fuchs 	0.0
Betweeness Centrality:  N. Gregory Mankiw 	0.031599140577
Betweeness Centrality:  Philippe Rigollet 	0.0
Betweeness Centrality:  Kristen Monaco 	0.0
Betweeness Centrality:  Valerie Ramey 	0.0
Betweeness Centrality:  Elizabeth Lyons 	0.0
Betweeness Centrality:  Michael H. Belzer 	0.0
Betweeness Centrality:  Neil Malhotra 	0.0
Betweeness Centrality:  Gilbert E. Metcalf 	0.0
Betweeness Centrality:  Matthew D. Shapiro 	0.00980662983425
Betweeness Centrality:  Pietro Ortoleva 	0.00184162062615
Betweeness Centrality:  Dolan Antenucci 	0.0
Betweeness Centrality:  Jonathan Zinman 	0.000644567219153
Betweeness Centrality:  Ahmed Khwaja 	0.0
Betweeness Centrality:  Pierre-Olivier Weill 	0.0
Betweeness Centrality:  Patrick Eichenberger 	0.0
Betweeness Centrality:  lawrence summers 	0.0
Betweeness Centrality:  Vicente Cuñat 	0.0
Betweeness Centrality:  Kusum L. Ailawadi 	0.0
Betweeness Centrality:  John Y. Campbell 	0.0
Betweeness Centrality:  Jura Liaukonyte 	0.0
Betweeness Centrality:  Peter Kondor 	0.0
Betweeness Centrality:  Tyler Shumway 	0.0
Betweeness Centrality:  Margaret Levenstein 	0.0
Betweeness Centrality:  Pingzhao Hu 	0.0

In [13]:
avg_betweenness =  sum(btwn.values())/len(btwn)
print 'Avergage Betweenness: ', avg_betweenness


Avergage Betweenness:  0.00179743522285

In [16]:
plt.figure(figsize = (8, 5))
plt.hist(btwn.values())
plt.title("Betweeness Centrality Distribution", fontsize = 15)
plt.show()



In [ ]: