Playing around to see what one can do using Gist pages for writing.
This file contains hidden or 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
#!/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): |
This file contains hidden or 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
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] |
OlderNewer