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 matplotlib import use | |
from pylab import * | |
from scipy.stats import beta, norm, uniform | |
from random import random | |
from numpy import * | |
import numpy as np | |
import os | |
# Input data |
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 pylab import * | |
E = 1.5 # exercise level | |
height = 6*12 #Height in inches | |
a = E * (66 + 12.7*height) / 3500.0 | |
b = E * 6.23 / 3500 | |
g = E * 6.775 / (365*3500.0) | |
age_range = (28, 40) | |
t = arange(age_range[0]*365,age_range[1]*365) |
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 numpy import * | |
from scipy.stats import beta | |
import random | |
class BetaBandit(object): | |
def __init__(self, num_options=2, prior=None): | |
self.trials = zeros(shape=(num_options,), dtype=int) | |
self.successes = zeros(shape=(num_options,), dtype=int) | |
self.num_options = num_options |
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 numpy import * | |
from scipy.stats import beta | |
class BetaBandit(object): | |
def __init__(self, num_options=2, prior=(1.0,1.0)): | |
self.trials = zeros(shape=(num_options,), dtype=int) | |
self.successes = zeros(shape=(num_options,), dtype=int) | |
self.num_options = num_options | |
self.prior = prior |
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 pylab import * | |
from scipy.stats import * | |
num_adults = 227e6 | |
basic_income = 7.25*40*50 | |
labor_force = 154e6 | |
disabled_adults = 21e6 | |
current_wealth_transfers = 3369e9 | |
def jk_rowling(num_non_workers): |
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 pylab import * | |
from scipy.stats import beta, norm, uniform | |
from random import random | |
from numpy import * | |
import numpy as np | |
import os | |
# Input data | |
prior_params = [ (1, 1), (1,1) ] |
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 pylab import * | |
from scipy.stats import uniform, binom, expon, beta | |
true_gamma = 0.5 | |
N = 600 | |
T = 15 | |
data = zeros((2, N), dtype=float) | |
event_times = data[0,:] | |
event_times[:] = uniform(0,15).rvs(N) |
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
#!/bin/sh | |
old=$1 | |
new=$2 | |
if [ $old ] && [ $new ] | |
then | |
echo "Cloning $old, saving result as $new" | |
else | |
echo "Usage: clone-ubuntu.sh oldname newname" |
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
File "C:\Users\stucc\Dropbox\src\daywalker\test\..\readme.md", line 86, in readme.md | |
Failed example: | |
history[['open', 'high', 'low', 'close', 'volume', 'divCash', 'splitFactor']] | |
Expected: | |
open high low close volume divCash splitFactor | |
date | |
2004-08-12 17.50 17.58 17.5 17.50 2545100 0.0 1.0 | |
2004-08-13 17.50 17.51 17.5 17.51 593000 0.0 1.0 | |
2004-08-16 17.54 17.54 17.5 17.50 684700 0.0 1.0 | |
Got: |
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 config | |
from azure.keyvault.secrets import SecretClient | |
from azure.identity import ClientSecretCredential | |
from azure.core.exceptions import ResourceNotFoundError | |
import time | |
class AzureKeyVaultConfiguration(config.Configuration): | |
""" | |
Configuration class. |
NewerOlder