Skip to content

Instantly share code, notes, and snippets.

@bwhite
bwhite / driver.py
Created July 30, 2012 03:56
Hadoopy Example: Vector Stats
import hadoopy
import numpy as np
import logging
logging.basicConfig(level=logging.DEBUG)
hdfs_output = 'hadoopy_example/vecstats'
def main():
if hadoopy.exists(hdfs_output):
@fccoelho
fccoelho / cgibbs.pyx
Created December 28, 2010 09:37
Comparison of MCMC implementations in Python and Cython. This is discussed here: http://pyinsci.blogspot.com/2010/12/efficcient-mcmc-in-python.html
'''
Pure cython version
compile with:
$ cython cgibbs.pyx
$ gcc -shared -pthread -fPIC -fwrapv -O2 -Wall -fno-strict-aliasing -I/usr/include/python2.6 -o cgibbs.so cgibbs.c
then import from python shell and call main()
'''
import random,math, time