Skip to content

Instantly share code, notes, and snippets.

Reginald Eps endlesspint8

Block or report user

Report or block endlesspint8

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View convert_number_ratio.py
# http://stackoverflow.com/questions/929103/convert-a-number-range-to-another-range-maintaining-ratio
def new_value(orig_inputs, new_min, new_max, old_value):
old_min = min(orig_inputs)
old_max = max(orig_inputs)
old_range = old_max - old_min
new_range = new_max - new_min
new_value = ((old_value - old_min) * new_range / old_range) + new_min
return new_value
View nfl_10k_season_sim.py
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
matplotlib.style.use('ggplot')
%matplotlib inline
# team xref information
team_xref = pd.read_csv('data/team_xref.csv', sep=';')
print team_xref.shape
View us_craft_import_bbl.py
def craft_import_match(year, overall, overall_growth, craft, craft_growth, imp, imp_growth):
print "starting metrics:"
print "year:", year
print "overall %d BBLS and %3.3f percent growth" % (overall, overall_growth)
print "craft %d BBLS & %2.3f percent growth" % (craft, craft_growth)
print "import %d BBLS & %2.3f percent growth" % (imp, imp_growth)
print "\nyear\toverall_bbl\tcraft_bbl\timport_bbl"
while craft < imp:
year += 1
View lattice_less_naive.py
import numpy as np
def lat_path(x):
grid = (x+1) * (x+1)
test_m = np.zeros(grid).reshape(x+1, x+1)
for row in range(x+1):
for col in range(x+1):
View load_words_NL.py
import csv
dutch_dict = {}
# stop words
with open('stopwords/stopwords_table_wTrans.csv', 'r') as f:
reader = csv.reader(f)
reader.next()
for row in reader:
dutch_dict[row[1]] = row[5]
You can’t perform that action at this time.