question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

is there a way to know which players are out?

See original GitHub issue

Title.

I try to wait 30 minutes or so before lock so that I can know exactly who is out. It worked for 2 or 3 days, but now it has been just putting any player even when they are out. Is there a way to make it only put players that are actually playing?

For a showdown on Draftkings, I tried the below code and it still had them in almost every lineup. I will update if I get it working, but am very curious as to why it will not remove the players from the optimizer, it just runs and puts them in basically every lineup.

from pydfs_lineup_optimizer import Site, Sport, get_optimizer, CSVLineupExporter

optimizer = get_optimizer(Site.DRAFTKINGS_CAPTAIN_MODE, Sport.BASKETBALL)

optimizer.load_players_from_csv("DKSalaries.csv")

#Declare players that are out
geo = optimizer.get_player_by_name('Paul George')
harrell = optimizer.get_player_by_name('Harrell')
craw = optimizer.get_player_by_name('Crawford')
bev = optimizer.get_player_by_name('Beverley')
din = optimizer.get_player_by_name('Dinwiddie')
jor = optimizer.get_player_by_name('DeAndre Jordan')
irving = optimizer.get_player_by_name('Irving')
prin = optimizer.get_player_by_name('Prince')
chan = optimizer.get_player_by_name('Chandler')
durant = optimizer.get_player_by_name('Durant')
beasley = optimizer.get_player_by_name('Beasley')

optimizer.remove_player(geo)
optimizer.remove_player(harrell)
optimizer.remove_player(craw)
optimizer.remove_player(bev)
optimizer.remove_player(din)
optimizer.remove_player(jor)
optimizer.remove_player(irving)
optimizer.remove_player(prin)
optimizer.remove_player(chan)
optimizer.remove_player(durant)
optimizer.remove_player(beasley)

geo.max_exposure = 0
harrell.max_exposure = 0
craw.max_exposure = 0
bev.max_exposure = 0
din.max_exposure = 0
jor.max_exposure = 0
irving.max_exposure = 0
prin.max_exposure = 0
chan.max_exposure = 0
durant.max_exposure = 0
beasley.max_exposure = 0

leonard = optimizer.get_player_by_name('Leonard')
levert = optimizer.get_player_by_name('LeVert')

leonard.min_exposure = 0.8
levert.min_exposure = 0.8

lineups = optimizer.optimize(n=20, max_exposure=0.4)

for lineup in lineups:
    print(lineup)

optimizer.export('results.csv')

Edit: Also is it normal that Draftkings works perfectly with the exported csv, but with Fanduel I have to edit the lines since it is a different format?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15

github_iconTop GitHub Comments

1reaction
pandabearnoahcommented, Aug 10, 2020

got it working. TYVM!

0reactions
Denwen12commented, Aug 10, 2020

no problem, glad i could help you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Injury report: when pro teams have to reveal player's status
With the practice report, all players who have reportable injuries must be listed here, even if the player takes all the reps in...
Read more >
How to decipher the NFL injury report - CBSSports.com
PROBABLE: The NFL says that players who have a virtual certainty of playing should be listed here. It's rare to see a player...
Read more >
Official Latest NFL Injury Report for Players - NFL.com
Get the current Official National Football League player injury report on your favorite team week by week.
Read more >
NBA Injuries | ESPN
Joe Harris, SF, Dec 23, Out, Harris (knee) has been ruled out for Friday's game against the Bucks, Kristian Winfield of the New...
Read more >
How to find out what game someone is playing on Roblox ...
It's quite annoying to do, but possible. You can either guess the game and go to the 'Servers' list, and scroll down to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found