Skip to content

Instantly share code, notes, and snippets.

View chrisalbon's full-sized avatar

Chris Albon chrisalbon

View GitHub Profile
{
"metadata": {
"name": "",
"signature": "sha256:c3353bdfe380793a0b7eb927af7533bc567dd752cb852517d89eac65a196723b"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"metadata": {
"name": "",
"signature": "sha256:63da596dd1a5eb6dfdf934f5552fb0616c2fd21bf522ac0cafe519eda3351981"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"total": 46830,
"data": [
{
"remoteID": "44268-1248",
"tags": [
{
"confidence": 1,
"name": "Furniture"
}
import numpy as np
x = ['Family Practice', 'Internal Medicine', 'Family Practice', 'Family Practice']
y = [0,0,0,1]
score = 0
def hardcoded_rules(x,y,score):
if len(x) < 3 and max(y) < 3:
score = -1
elif np.unique(y)[0] == 1:
@chrisalbon
chrisalbon / gist:2d07b745a7e378cd2685
Created July 1, 2015 17:15
Testing Popily Embeds In Project Jupyter
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Testing Popily Embeds In Project Jupyter"
]
},
{
{'Alabama': 4849377,
'Alaska': 736732,
'Arizona': 6731484,
'Arkansas': 2966369,
'California': 38802500,
'Colorado': 5355866,
'Connecticut': 3596677,
'Delaware': 935614,
'District of Columbia': 658893,
'Florida': 19893297,
# Brute Force D20 Roll Simulator
# Import random module
import random
# Create a variable with a TRUE value
rolling = True
# while rolling is true
while rolling:
import pandas as pd
index = pd.date_range('1/1/2000', periods=20000, freq='30min')
series = pd.Series(range(20000), index=index)
series.groupby(series.index.hour).sum()
### Keybase proof
I hereby claim:
* I am chrisalbon on github.
* I am chrisalbon (https://keybase.io/chrisalbon) on keybase.
* I have a public key ASBI8zFqR11PMiDce5FTxa7M57P8WLTxMkdLD-tt72qjjAo
To claim this, I am signing this object:
@chrisalbon
chrisalbon / gist:0a55b7b5ef6584e672cd
Created September 8, 2014 13:46
map your google data
# coding: utf-8
# # Map Your Google Location History
#
# ## Step 1: Download your Google Location History
#
# Google makes this process very easy. Go here to [download your location history data](https://www.google.com/settings/takeout) and unzip it.
# ## Step 2: Run this script