Skip to content

Instantly share code, notes, and snippets.

View springcoil's full-sized avatar

Peadar Coyle springcoil

View GitHub Profile
@springcoil
springcoil / ETL_python.md
Last active October 26, 2015 18:42
What data pipelines are there in python?

I want to do ETL and I want to do it in python. What tools do I have access to?

@springcoil
springcoil / probineq.ipynb
Created November 9, 2015 17:04
A short article on probability inequalities
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@springcoil
springcoil / conversion.ipynb
Last active November 14, 2015 13:17
Conversion PyMC3
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@springcoil
springcoil / numpy_matrix_fun.ipynb
Created November 16, 2015 14:43
Some NumPy fun with the new operators
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@springcoil
springcoil / NLP_Inside_Airbnb.ipynb
Created December 1, 2015 12:26
Using data from the Paris version of Airbnb I hacked together a little Topic Model in Scikitlearn
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@springcoil
springcoil / imagesimilarity.ipynb
Created December 5, 2015 18:43
Image Similarity Database based on primary colour - based on Thomas Hungers work
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@springcoil
springcoil / luigi_email_script.py
Created December 9, 2015 17:16
A little email script to send a file via Luigi
class SendEmail(luigi.Task):
def run(self):
fromaddr = EMAIL
toaddr = EMAIL
msg = MIMEMultipart()
msg['From'] = fromaddr
msg['To'] = toaddr
msg['Subject'] = "Daily Update of Cohorts"
body = "Here is the cohort update"
msg.attach(MIMEText(body, 'plain'))
@springcoil
springcoil / Factorial2.scala
Created December 15, 2015 23:40
Really simple factorial example written in Scala
object Factorial2 {
def main(args: Array[String])
{ for (i <- 1 to 30)
println("Factorial of " + i + ": = " + factorial(i))
}
def factorial(n: BigInt): BigInt = {
if (n <= 1)
1
else
@springcoil
springcoil / gist:5480336
Created April 29, 2013 08:22
Python Traceback error, from Ipython code. Basically I attempted to replicate by writing myself the Sean J.Taylor code.
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-34-180a07193cfb> in <module>()
21 for eval_name, evaluation in evaluations.iteritems():
22 for year in range(2002, 2013):
---> 23 metric = evaluation(ranker, year)
24 results.append({
25 'rank': name,
<ipython-input-34-180a07193cfb> in <lambda>(rank, year)
@springcoil
springcoil / luigi_emails.py
Last active December 17, 2015 20:07
experiment_with_email_luigi.py
# these modules are needed for the task
import luigi
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email import encoders
from dataextract import Manager
import pandas as pd
import json