Skip to content

Player's Actual Position in Box Player Class #580

Answered by DesiPilla
nineteenlights asked this question in Ideas
Discussion options

You must be logged in to vote

Hi @nineteenlights , I implement an automation of this stat in a repo of my own. The relevant code is here.

Essentially, you can extract a team's Lineup pretty easily:

def get_lineup(
    league: League, team: Team, week: int, box_scores: Optional[List[BoxScore]] = None
) -> List[Player]:
    """Return the lineup of the given team during the given week"""
    # Get the lineup for the team during the specified week
    if box_scores is None:
        box_scores = league.box_scores(week)

    assert box_scores is not None

    lineup = []
    for box_score in box_scores:
        if team == box_score.home_team:
            lineup = box_score.home_lineup
        elif team == box_score.away_team:…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by nineteenlights
Comment options

You must be logged in to vote
1 reply
@nineteenlights
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants