This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
required packages: | |
numpy | |
matplotlib | |
basemap: http://matplotlib.org/basemap/users/installing.html | |
shapely: https://pypi.python.org/pypi/Shapely | |
descartes: https://pypi.python.org/pypi/descartes | |
random |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from scipy.sparse import csc_matrix | |
import random | |
def column(matrix, i): | |
return [row[i] for row in matrix] | |
def pageRank(G, s = 0.85, maxerr = .001): | |
""" | |
Computes the pagerank for each of the n states. |