def get_all_skater_fps(): skater_page = hr.get_all_skaters_page() skaters = hr.get_table(skater_page) skaters = skaters.replace('', 0) players = skaters['Player'].astype('str') games = skaters['GP'].astype('float64') goals = skaters['G'].astype('float64') assists = skaters['A'].astype('float64') pts = skaters['PTS'].astype('float64') plus_minus = skaters['+/-'].astype('float64') ppg = skaters['PPG'].astype('float64') shg = skaters['SHG'].astype('float64') gwg = skaters['GW'].astype('float64') ppa = skaters['PPA'].astype('float64') sha = skaters['SHA'].astype('float64') shots = skaters['S'].astype('float64') blocks = skaters['BLK'].fillna(0).astype('float64') hits = skaters['HIT'].astype('float64') fps = (goals * 5) + (assists * 3) + (plus_minus * 1) + (ppg * 2) + ( ppa * 2) + (gwg * 1) + (shg * 2) + (sha * 2) + (shots * 0.1) + ( blocks * 0.025) + (hits * 0.025) fps_g = fps / games df = build_fp_table(players, fps, fps_g) return df
def get_all_goalie_fps(): goalie_page = hr.get_all_goalies_page() goalies = hr.get_table(goalie_page) goalies = goalies.replace('', 0) players = goalies['Player'].astype('str') games = goalies['GP'].astype('float64') wins = goalies['W'].astype('float64') losses = goalies['L'].astype('float64') otl = goalies['T/O'].astype('float64') ga = goalies['GA'].astype('float64') saves = goalies['SV'].astype('float64') shutouts = goalies['SO'].astype('float64') fps = (wins * 5) - (losses * 2) - (ga * 1) + (saves * 0.2) + (shutouts * 3) fps_g = fps / games df = build_fp_table(players, fps, fps_g) return df
def load_goalie_basic(): page = hr.get_all_goalies_page() df = hr.get_table(page) refresh_table('NHL_PLAYER', 'goalie_basic', df)
def load_skater_advanced(): page = hr.get_advanced_skaters_page() df = hr.get_table(page) refresh_table('NHL_PLAYER', 'skater_advanced', df)
def load_skater_basic(): page = hr.get_all_skaters_page() df = hr.get_table(page) refresh_table('NHL_PLAYER', 'skater_basic', df)