You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using "optimizer.player_pool.load_players(FDplayers)" function to load the players from a database query.
It appears to be loading the FandDuel players correctly, but when I try "lineup_generator = optimizer.optimize(3)" -- How can I check to see if the data has loaded into the Optimizer correctly?
Here's my issue, I'm Getting these errors: pydfs_lineup_optimizer.solvers.exceptions.SolverInfeasibleSolutionException: ['positions_D', 'budget', 'total_players', '_C1']
pydfs_lineup_optimizer.exceptions.GenerateLineupException: Can't generate lineups. Following constraints are not valid: positions_D,budget,total_players
My code is fairly generic:
Data returned from DB Query consists of: (Team, PlayerName, Position, Salary, FantasyPoints)
optimizer = get_optimizer(Site.FANDUEL, Sport.FOOTBALL)
allPlayerInfo=mF.getNFLPlayerInfo('FanDuel') ## Query database and return Player Data.
FDplayers = []
for i, player_info in enumerate(allPlayerInfo):
name = player_info[1].split(' ')
FDplayers.append(Player(
int(i),
name[0], #First Name
name[1], #Last name
player_info[2].split('-'), # Split Positions: for Fanduel use '-' for Draftkings use '/'
player_info[0], # This should be TeamShort name.
float(player_info[3]), #This should be Fantasy Salary
float(player_info[4]) #This should be Fantasy Points
))
optimizer.player_pool.load_players(FDplayers)
lineup_generator = optimizer.optimize(3)
Can someone, Please help and thanks.
The text was updated successfully, but these errors were encountered:
I'm using "optimizer.player_pool.load_players(FDplayers)" function to load the players from a database query.
It appears to be loading the FandDuel players correctly, but when I try "lineup_generator = optimizer.optimize(3)"
-- How can I check to see if the data has loaded into the Optimizer correctly?
Here's my issue, I'm Getting these errors:
pydfs_lineup_optimizer.solvers.exceptions.SolverInfeasibleSolutionException: ['positions_D', 'budget', 'total_players', '_C1']
pydfs_lineup_optimizer.exceptions.GenerateLineupException: Can't generate lineups. Following constraints are not valid: positions_D,budget,total_players
My code is fairly generic:
Data returned from DB Query consists of: (Team, PlayerName, Position, Salary, FantasyPoints)
[('SFO', 'Brock Purdy', 'QB', 6900.0, 15.43), ('SFO', 'Christian McCaffrey', 'RB', 9000.0, 18.03), ('SFO', 'Elijah Mitchell', 'RB', 5600.0, 6.56),etc...]
Can someone, Please help and thanks.
The text was updated successfully, but these errors were encountered: