This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Grid 01 | |
003020600 | |
900305001 | |
001806400 | |
008102900 | |
700000008 | |
006708200 | |
002609500 | |
800203009 | |
005010300 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import numpy as np | |
box_slices = { | |
0: slice(0, 3), | |
1: slice(0, 3), | |
2: slice(0, 3), | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from scipy import optimize, sparse | |
board_coords = np.array([ | |
[0, 1, 2], | |
[0, 4, 3], | |
[0, 7, 4], | |
[1, 0, 6], | |
[1, 8, 3], | |
[2, 2, 4], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pandas as pd | |
from scipy import stats | |
from statsmodels.stats import inter_rater | |
def fleiss_standard_error(table): | |
# not included in statsmodels | |
# only returns overall kappa value |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This took me a while to figure out so posting for posterity. | |
plt.interactive(False) is important, if you want the grid to only show up | |
when `display`ed. Since `sns.FacetGrid` can take a few seconds depending | |
on the size of your data, this displays a spinner in the notebook cell | |
until the new graph is ready to render. | |
""" | |
import matplotlib.pyplot as plt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib | |
import docker | |
def get_manifest_auth_token(repo): | |
# https://docs.docker.com/registry/spec/auth/token/ | |
query = urllib.parse.urlencode({ | |
'service': 'registry.docker.io', | |
'scope': 'repository:{repo}:pull'.format(repo=repo) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Heavily inspired by the R package bindata. | |
""" | |
import numpy as np | |
from scipy import interpolate | |
from scipy import stats | |
def corr_to_joint(corr, marginals): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
import glob | |
import os | |
import shutil | |
import re | |
from collections import namedtuple | |
import subprocess | |
from subprocess import PIPE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from boto3 import client | |
client = client(service_name='ec2') | |
prices = client.describe_spot_price_history(InstanceTypes=["m3.medium"], | |
AvailabilityZone="us-east-1a") | |
df = pd.DataFrame(prices['SpotPriceHistory']) | |
df.set_index("Timestamp", inplace=True) | |
df["SpotPrice"] = df.SpotPrice.astype(float) |
NewerOlder