Skip to content

Instantly share code, notes, and snippets.

View dkmehrmann's full-sized avatar

Andrew Mehrmann dkmehrmann

View GitHub Profile
import requests
from bs4 import BeautifulSoup
import pandas as pd
import datetime
import time
import os
# CONSTANTS
expected_ga=4908874
expected_pa=6902763
@dkmehrmann
dkmehrmann / consumption_climate_change.py
Created July 5, 2020 20:56
Code to compare GDP to CO2 Levels since the year 0 AD
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
gdp_ = 'http://www.ggdc.net/MADDISON/Historical_Statistics/vertical-file_02-2010.xls'
gdp = pd.read_excel(gdp_, sheet_name='PerCapita GDP', header =2, usecols=[0, 182], names=['year', 'GlobalGDPPerCapita']).dropna()
gdp.year = gdp.year.astype(int)
co2_ = 'ftp://data.iac.ethz.ch/CMIP6/input4MIPs/UoM/GHGConc/CMIP/yr/atmos/UoM-CMIP-1-1-0/GHGConc/gr3-GMNHSH/v20160701/mole_fraction_of_carbon_dioxide_in_air_input4MIPs_GHGConcentrations_CMIP_UoM-CMIP-1-1-0_gr3-GMNHSH_0000-2014.csv'
co2 = pd.read_csv(co2_)
from __future__ import print_function
import sys
from nhlscrapi.games.game import Game, GameKey, GameType
from nhlscrapi.games.cumstats import Score, ShotCt, Corsi, Fenwick
print(sys.version)
season = 2014 # 2013-2014 season
game_num = 1226 #
game_type = GameType.Regular # regular season game
@dkmehrmann
dkmehrmann / convert.sh
Last active February 14, 2019 01:36
Blogging with Jupyter Notebooks and Jekyll
#!/bin/bash
# example use:
# [~/gitrepos/dkmehrmann.github.io/_ipynb]$ ../scripts/convert.sh google_maps.ipynb
#
BUILD_DIR="/home/andrew/gitrepos/dkmehrmann.github.io/_ipynb/"
POST_DIR="/home/andrew/gitrepos/dkmehrmann.github.io/_posts/"
# use nbconvert on the file