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 sys | |
import re | |
VARIABLE_ASSIGNMENT_REGEX = r'[a-zA-Z_]*=' | |
SQR = 'SQR' | |
ABS = 'ABS' | |
INI = '^' |
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
from __future__ import division | |
from random import randint | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
import pandas as pd | |
SAMPLES_PER_N_VALUE = 10000 | |
N_VALUES = [2**n for n in (range(10))] |
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
# Before executing this script, run the following in your terminal: | |
# virtualenv . | |
# source bin/activate | |
# pip install beautifulsoup4 | |
from bs4 import BeautifulSoup | |
import urllib2 | |
path = "http://www12.statcan.gc.ca/census-recensement/2016/as-sa/98-200-x/2016001/98-200-x2016001-eng.cfm" |
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
def __numpy_to_string(A): | |
return A.tostring().hex() | |
def __string_to_numpy(S): | |
return np.frombuffer(bytes.fromhex(S), dtype=np.float32) |
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 seaborn as sns | |
import pandas as pd | |
import pylab as plt | |
import numpy as np | |
import itertools | |
import random | |
import time | |
def brute_force(cnf): |
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
""" | |
A tool to calculate probabilities in Perudo. | |
David Fernig, 2018 | |
""" | |
from __future__ import division | |
import scipy.special | |
class Round(object): |