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 time | |
from selenium import webdriver | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.chrome.service import Service | |
from twilio.rest import Client | |
# Find your Account SID and Auth Token at twilio.com/console | |
# and set the environment variables. See http://twil.io/secure | |
# os.environ['TWILIO_ACCOUNT_SID'] |
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 is a script to find the answer to the Riddler. | |
# https://fivethirtyeight.com/features/can-you-hunt-for-the-mysterious-numbers/ | |
import random, time | |
def find_1_digit_factors(target): | |
factors = [] | |
for value in range(1, 10): | |
if (target % value == 0): | |
factors.append(value) |
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 itertools import permutations | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib.patches import Polygon | |
num_rings = 5 | |
def find_config(num_rings): | |
rings = [i for i in range(num_rings)] | |
for i in range(num_rings-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
def eval_equation(braces, input): | |
# Takes in input as a list of numbers | |
# Takes in braces as a list of "-1"s (closed |'s) and 1's (opened |'s) | |
# Returns the evaluation | |
eq = "" | |
for i in range(num_braces): |
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 | |
import itertools, time, string | |
fname = "enable1.txt" | |
def read_in_word_list(fname): | |
data = [] | |
with open(fname, "r") as word_list: | |
for w in word_list: | |
w = w.rstrip('\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
Sub csv() | |
Dim MyFileName As String | |
Dim CurrentWB As Workbook, TempWB As Workbook | |
Set CurrentWB = ActiveWorkbook | |
ActiveWorkbook.ActiveSheet.UsedRange.Copy | |
Set TempWB = Application.Workbooks.Add(1) | |
With TempWB.Sheets(1).Range("A1") |
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 pickle | |
import peloton | |
username = "username_1" | |
workouts = peloton.PelotonWorkout.list() | |
with open(username+".pkl","wb") as f: | |
pickle.dump(workouts,f) |
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 math, random | |
import matplotlib.pyplot as plt | |
import matplotlib.cm as cm | |
plt.style.use('dark_background') | |
def create_point(): | |
x = random.random() | |
y = random.random() | |
return x,y |
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 random | |
max_outs = 3 | |
innings = 9 | |
game_num = 100000 #num games to run for each matchup | |
def batter_up(batting_power,batting_perc,i_bases,i_outs): | |
hit = random.random() < batting_perc | |
if hit: | |
if batting_power == 1: |