Skip to content

Instantly share code, notes, and snippets.

View wwright999's full-sized avatar

Maynard wwright999

  • Chicago
View GitHub Profile
@wwright999
wwright999 / quandl_futures_to_sql.py
Last active December 7, 2017 19:40
Download Continuous Futures EOD data from Quandl.com and save in SQLlite database
import quandl
import pandas as pd
from sqlalchemy import create_engine
# Link to list of symbols
https://www.quandl.com/data/SCF-Continuous-Futures/documentation/documentation
# Sign up at Quandl.com to get Auth Token
token = 'your auth token from quandl.com'
@wwright999
wwright999 / InteractiveBroker.py
Created October 18, 2017 15:15
Interactive Broker Example
# Gist example of IB wrapper ...
#
# Download API from http://interactivebrokers.github.io/#
#
# Install python API code /IBJts/source/pythonclient $ python3 setup.py install
#
# Note: The test cases, and the documentation refer to a python package called IBApi,
# but the actual package is called ibapi. Go figure.
#
# Get the latest version of the gateway:
@wwright999
wwright999 / categorial_neural.py
Last active July 6, 2018 18:34
Tensor Flow Example of Neural Network with categorical variable encoding
import random
import pandas
from sklearn.cross_validation import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score
from sklearn.preprocessing import LabelEncoder
from sklearn.utils import check_array
import tensorflow as tf
@wwright999
wwright999 / mailchimp.py
Created September 26, 2017 07:53
export mailchimp data to csv
'''A python script to export the raw data from mailchimp lists and campaigns.
The output of this script will be a CSV file with the open and click rates for each campaign
and each list member (identified by an email.) You can use this data for further analysis
as seen here:
http://www.silota.com/docs/recipes/sql-email-customer-list-segmentation-lead-scoring.html
Written by Ganesh, 2017.
'''
import requests
@wwright999
wwright999 / permutation.py
Created September 15, 2017 21:52
Example of a resampling permutation test to determine the statistical significance or p-value of an observed difference between the effects of a drug versus a placebo:
# Example from "Statistics is Easy" by Dennis Shasha and Manda Wilson
from statistics import mean
from random import shuffle
drug = [54, 73, 53, 70, 73, 68, 52, 65, 65]
placebo = [54, 51, 58, 44, 55, 52, 42, 47, 58, 46]
observed_diff = mean(drug) - mean(placebo)
n = 10000
count = 0
@wwright999
wwright999 / 0_reuse_code.js
Created June 10, 2017 09:55
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console