{{ message }}

Instantly share code, notes, and snippets.

# Abraham Flaxman aflaxman

Created Jan 26, 2010
networkx-osm import open street map data as a networkx graph
View gist:287370
 """ Read graphs in Open Street Maps osm format Based on osm.py from brianw's osmgeocode http://github.com/brianw/osmgeocode, which is based on osm.py from comes from Graphserver: http://github.com/bmander/graphserver/tree/master and is copyright (c) 2007, Brandon Martin-Anderson under the BSD License """
Created Feb 11, 2010
We couldn’t find that file to show.
Created Feb 15, 2010
View data.py
 """ Class for holding species occurrence data, and associated covariates""" import csv class Data: def __init__(self, fname='data.csv'): self.raw_data = [d for d in csv.DictReader(open(fname))] self.seen = [] self.unseen = [] self.cov = {}
Created May 14, 2010
View spa.py
 """ Generate graphs from the spatial preferential attachment model, and animate them""" from pymc import runiform, rnormal from networkx import DiGraph, draw from pylab import clf, axis, savefig from numpy import maximum, minimum def perturb(x, e):
Created Jul 2, 2010
View sudoku.py
 from pylab import * import random index_set = [[i,j] for i in range(9) for j in range(9)] def solve(T): """ Find a solution to T, if possible T is a 9x9 array, with blank cells set to -1 T is changed to the solution, returns 'success' or 'failure'
Created Sep 23, 2010
View value_error_test.py
 from pymc import * def test(a0, b0): # use non-informative priors x = rbinomial(10, .5, 10) a = Uniform('a', lower=-1000, upper=1000, value=a0) b = Normal('b', mu=0, tau=.01, value=b0) @deterministic def theta(a=a, b=b):
Created Oct 14, 2010
View .gitignore
 *.pyc *.png *~
Created Oct 26, 2010