Skip to content

Instantly share code, notes, and snippets.

<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<script type="text/javascript">MathJax.Hub.Config({tex2jax: {processEscapes: true,
processEnvironments: false, inlineMath: [ ['$','$'] ],
displayMath: [ ['$$','$$'] ] },
asciimath2jax: {delimiters: [ ['$','$'] ] },
"HTML-CSS": {minScaleAdjust: 125 } });
</script>
@sgillies
sgillies / geo_interface.rst
Last active October 20, 2025 13:07
A Python Protocol for Geospatial Data

Author: Sean Gillies Version: 1.0

Abstract

This document describes a GeoJSON-like protocol for geo-spatial (GIS) vector data.

Introduction

@jseabold
jseabold / bootstrap_numpy.sh
Created March 23, 2012 20:16
bootstrap installations that depend on numpy
#! /bin/bash
# edit this to install whatever you want that depends on numpy after you
# reinstall numpy
# edit these variables or add to them
npsrc="$HOME/src/numpy/"
spsrc="$HOME/src/scipy/"
pdsrc="$HOME/src/pandas/"
smsrc="$HOME/statsmodels/statsmodels/"
@pmarreck
pmarreck / .profile
Created March 15, 2012 19:23
.profile/.bashrc hacks for OS X
# HOMEBREW CONFIG
# Move /usr/local/bin to the front of PATH by subbing it out and prepending
export PATH=/usr/local/bin:${PATH/\/usr\/local\/bin:/}
# add my user bin to PATH
export PATH=$PATH:~/bin
# stop checking for mail
unset MAILCHECK
@alextp
alextp / bayesopt.py
Created November 29, 2011 01:18
A trivial implementation of Bayesian optimization
# coding: utf-8
# An attempt at implementing Bayesian optimization according to
# Brochu, Cora, and de Freitas' tutorial
# http://haikufactory.com/files/bayopt.pdf
from sklearn import gaussian_process
import numpy as np
import scipy.optimize, scipy.stats as st
@nkabir
nkabir / mathjax.html
Created October 16, 2011 19:29
MathJax setup
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
@brantfaircloth
brantfaircloth / stdout_progress.py
Created May 27, 2011 06:02
pretty easy progress indicator
# this works just fine w/ multiprocess...
# now with more flushing
import sys
import time
sys.stdout.write("This is running")
sys.stdout.flush()
for i in range(5):
sys.stdout.write(".")
@esperlu
esperlu / mysql2sqlite.sh
Created April 27, 2011 05:46
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@fonnesbeck
fonnesbeck / least_squares.py
Created April 14, 2011 13:15
Least squares with equality constraint (taken and modified from http://fseoane.net/blog/2011/least-squares-with-equality-constrain/)
import numpy as np
from scipy import linalg
def lse(A, b, B, d, cond=None):
"""
Equality-contrained least squares.
The following algorithm minimizes ||Ax - b|| subject to the
constrain Bx = d.
@huyng
huyng / matplotlibrc
Created February 8, 2011 15:50
my default matplotlib settings
### MATPLOTLIBRC FORMAT
# This is a sample matplotlib configuration file - you can find a copy
# of it on your system in
# site-packages/matplotlib/mpl-data/matplotlibrc. If you edit it
# there, please note that it will be overridden in your next install.
# If you want to keep a permanent local copy that will not be
# over-written, place it in HOME/.matplotlib/matplotlibrc (unix/linux
# like systems) and C:\Documents and Settings\yourname\.matplotlib
# (win32 systems).