Skip to content

Instantly share code, notes, and snippets.

Avatar

Peadar Coyle springcoil

View GitHub Profile
View pymc3_normalizing_flow_beta_binomial.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@springcoil
springcoil / optics.py
Created Feb 8, 2016 — forked from rnowling/optics.py
Customer Segmentation Pipeline Prototype
View optics.py
"""
Copyright 2015 Ronald J. Nowling
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@springcoil
springcoil / numba_test.py
Created Oct 26, 2015 — forked from jhemann/numba_test.py
Testing numba's autojit decorator on simple code for matrix factorization.
View numba_test.py
# -*- coding: utf-8 -*-
#!/usr/bin/python
#
# Modified example of Albert Au Yeung's on matrix factorization:
# http://www.quuxlabs.com/blog/2010/09/matrix-factorization-a-simple-tutorial-and-implementation-in-python/#source-code
import numpy as np
from numba.decorators import autojit, jit
@springcoil
springcoil / FremontBridge.ipynb
Created Oct 20, 2015 — forked from jakevdp/FremontBridge.ipynb
Fremont Bike Counts 2015
View FremontBridge.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@springcoil
springcoil / assert_frames_equal.ipynb
Created Oct 5, 2015 — forked from jiffyclub/assert_frames_equal.ipynb
Example of a function to compare two DataFrames independent of row/column ordering and with handling of null values.
View assert_frames_equal.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@springcoil
springcoil / basic_income_monte_carlo.py
Last active Aug 29, 2015 — forked from stucchio/basic_income_monte_carlo.py
Monte carlo simulation of basic income/basic job calculations, from blog.
View basic_income_monte_carlo.py
from pylab import *
from scipy.stats import *
num_adults = 227e6
basic_income = 7.25*40*50
labor_force = 154e6
disabled_adults = 21e6
current_wealth_transfers = 3369e9
def jk_rowling(num_non_workers):
View machine-create.sh
docker-machine create \
--driver amazonec2 \
--amazonec2-access-key $ACCESS_KEY \
--amazonec2-secret-key $SECRET_KEY \
--amazonec2-vpc-id $VPC \
--amazonec2-security-group $SECURITY_GROUP \
--amazonec2-instance-type "m4.2xlarge" \
--amazonec2-root-size 20 \
--amazonec2-request-spot-instance \
--amazonec2-spot-price 0.20 \
View report-runner.py
# -*- coding: utf-8 -*-
"""
Sample report generation script from pbpython.com
This program takes an input Excel file, reads it and turns it into a
pivot table.
The output is saved in multiple tabs in a new Excel file.
"""
View pandas_dbms.py
# -*- coding: utf-8 -*-
"""
LICENSE: BSD (same as pandas)
example use of pandas with oracle mysql postgresql sqlite
- updated 9/18/2012 with better column name handling; couple of bug fixes.
- used ~20 times for various ETL jobs. Mostly MySQL, but some Oracle.
to do:
save/restore index (how to check table existence? just do select count(*)?),
finish odbc,
@springcoil
springcoil / gist:3231352
Created Aug 1, 2012 — forked from swannodette/gist:3217582
sudoku_compact.clj
View gist:3231352
(ns sudoku
(:refer-clojure :exclude [==])
(:use clojure.core.logic))
(defn get-square [rows x y]
(for [x (range x (+ x 3))
y (range y (+ y 3))]
(get-in rows [x y])))
(defn init [vars hints]