def get_team_scores(df_schedule, team, week):
  """Get all scores for a team

  :param df_schedule: data frame with scores and team ids for each game
  :param team: id for team
  :param week: current week
  :return: series of scores for team up to week
  """
  return (
    df_schedule
    .query(f'(home_id=={team} | away_id=={team}) & (matchupPeriodId <= {week} & winner != "UNDECIDED")')
    .apply(lambda x: x.home_total_points if x.home_id == team else x.away_total_points, axis=1)
  )