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 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
favoriteTeam = 'TBL' | |
eastern = ((('TBL', 'NJD'), ('BOS', 'TOR')), (('WSH', 'CBJ'), ('PIT', 'PHI'))) | |
western = ((('NSH', 'COL'), ('WPG', 'MIN')), (('VGK', 'LAK'), ('ANA', 'SJS'))) | |
championship = (eastern, western) |
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 numpy as np | |
from scipy.sparse import csr_matrix | |
import pymysql | |
from fuzzywuzzy import fuzz | |
# display results to 3 decimal points, not in scientific notation | |
pd.set_option('display.float_format', lambda x: '%.3f' % x) |
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
SELECT currentRank.rank, currentRank.bggid, IFNULL(g.name, currentRank.bggid) AS gameName, historicalRank.RowNumber AS StreakInDays | |
FROM | |
( | |
SELECT hg.bggid, hg.rank | |
FROM hotgame AS hg | |
WHERE DATE(hg.date) = CURDATE() | |
) AS currentRank | |
JOIN | |
( | |
SELECT |
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 sqlite3 | |
from datetime import datetime, date | |
from operator import itemgetter | |
firstmonth = '2016-05' | |
lastmonth = '2016-06' | |
# Connect to SQLite Database |
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 glob | |
from PIL import Image, ImageDraw, ImageFont, PdfImagePlugin, _imaging ## was from PIL | |
from math import ceil | |
import os | |
badge_loc = 'border2.png' # badge template | |
filename = 'names3.txt' # text file with names |
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 nflgame as n | |
import time, smtplib | |
def send(SUBJECT, TEXT): | |
gmail_user = 'you@emailaddress.com' | |
gmail_pwd = 'YourVerySecurePassword' | |
server = smtplib.SMTP("smtp.gmail.com", 587) |
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 sqlite3 | |
import matplotlib.pyplot as plt | |
import numpy as np | |
db_loc = 'gencon_test.sqlite' | |
conn = sqlite3.connect(db_loc) | |
c = conn.cursor() | |
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
""" | |
Pull hotness data from BGG (wwww.boardgamegeek.com) and put into SQLite Db | |
""" | |
from datetime import datetime, date | |
from xml.dom import minidom | |
import sqlite3, unicodedata, urllib2, time, sys | |
def translate(name): | |
try: |
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 requests | |
import mysql.connector | |
from xml.dom import minidom | |
import urllib2, sys, re | |
from BeautifulSoup import BeautifulSoup as bs | |
menu_select = "1" | |
# to do: check to see if inventory table exists. If not, create it. | |
# to do: check to see if replica bgg database exists. If not, don't use it. |
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 xml.dom.minidom import parse | |
import matplotlib.pyplot as plt | |
import sqlite3, urllib2, unicodedata, time | |
import numpy as np | |
import sys | |
def strip_accents(s): | |
return ''.join(c for c in unicodedata.normalize('NFD', s) | |
if unicodedata.category(c) != 'Mn') |
NewerOlder