Skip to content

Instantly share code, notes, and snippets.

@rpmuller
rpmuller / ftree.py
Created July 12, 2013 20:36
Mandelbrot and frame's binary fractal trees
#!/usr/bin/env python
"""\
Mandelbrot and Frame's (Binary) Fractal Trees.
See http://www.math.union.edu/research/fractaltrees/
"""
import os
from math import sin,cos,pi
def ftree(iter,origin,t,r,theta,dtheta):
@rpmuller
rpmuller / Testing.md
Last active December 19, 2015 17:08
Testing Gist Pages

Playing around to see what one can do using Gist pages for writing.

@rpmuller
rpmuller / parse_orgtable.py
Created November 19, 2015 20:22
Parse an orgmode table into a Pandas dataframe
def parse_orgtable(s):
"""Parse an org-table (input as a multiline string) into a Pandas data frame."""
# This didn't quite work, because spaces messed things up
#import cStringIO
#table = pd.read_table(cStringIO.StringIO(s),sep='|',skiprows=[1],skipinitialspace=True)
#table = table.drop(table.columns[[0,-1]],1)
# I suppose I could have simply run strip() on all of the resulting column names, since that was the problem
def parseline(l):
w = l.split('|')[1:-1]
return [wi.strip() for wi in w]