Ejemplo n.º 1
0
def get_season_and_player_df(year):
    """
    given a year, returns a dataframe of season and player data
    """

    season_df = players_dao.get_season_by_year_df(year)
    player_df = players_dao.get_players_df()

    return _merge_season_player_df(season_df, player_df)
Ejemplo n.º 2
0
def get_seasons_for_top_metric(season_df, metric, limit=30):
    """
    gets the careers for the top {limit} players for given {metric}
    """

    top_df = get_top_for_metric(season_df, metric, query="experience >= 4 & minutes_played >= 600", limit=limit)

    career_df = players_dao.get_career_df(top_df.player_id.unique().tolist())
    player_df = players_dao.get_players_df()

    return _merge_season_player_df(career_df, player_df)