Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fanduel PlayersGroup Single Game Mode Q #304

Open
lightninglarry opened this issue Sep 28, 2021 · 9 comments
Open

Fanduel PlayersGroup Single Game Mode Q #304

lightninglarry opened this issue Sep 28, 2021 · 9 comments

Comments

@lightninglarry
Copy link

Trying to limit 1 qb per lineup at most.

oneqb= PlayersGroup([optimizer.get_player_by_name(Nickname) for Nickname in ('Trevor Lawrence', 'Joe Burrow')], max_from_group=1)
optimizer.add_players_group(oneqb)

heres the error
LineupOptimizerException: More than 1 player is found for: Trevor Lawrence

@Scottw1105
Copy link

You create player groups based on their player number.
Lamar Jackson(19610274) (his CPT player number) & Colts(19610353)

group = PlayersGroup(optimizer.player_pool.get_players('19610274', '19610353'), max_from_group=1)
optimizer.add_players_group(group)

Tested and worked perfectly fine for me.

@lightninglarry
Copy link
Author

You create player groups based on their player number. Lamar Jackson(19610274) (his CPT player number) & Colts(19610353)

group = PlayersGroup(optimizer.player_pool.get_players('19610274', '19610353'), max_from_group=1) optimizer.add_players_group(group)

Tested and worked perfectly fine for me.

tried it for fanduel with this code to limit each kicker in my lineup last night:
Kgroup = PlayersGroup(optimizer.player_pool.get_players('65439-22100', '65439-65128'), max_from_group=1)
optimizer.add_players_group(Kgroup)

didnt work. any ideas?

@lightninglarry
Copy link
Author

anyone have ideas on how to get the playersgroup to work in single game format? for Fanduel?

@lightninglarry
Copy link
Author

@Scottw1105 can you check this on Fanduel? This seems to work on DK, but i dont think it completely works for FD.
snippet:
NORBgroup = PlayersGroup(optimizer.player_pool.get_players('69236-42104', '69236-14211'), max_from_group=1)
optimizer.add_players_group(NORBgroup) #ids for Kamara and Ingram

still get both in some lineups together.

@EdCarGoes
Copy link

EdCarGoes commented Sep 13, 2024

Sorry to raise this zombie thread, but I am encountering this as well, specifically with FanDuel NFL single game mode. Here's my code:

if position_limit == True:
limit_group = PlayersGroup( players=[player for player in optimizer.players if position_to_limit in player.positions],
max_from_group=position_limit_amount)
print(limit_group)
optimizer.add_players_group(limit_group)

When I run this in a full lineup slate it does the job. Test without has an RB in the FLEX spot. Immediate test with those lines above
and setting position_limit = True, position_to_limit = "RB", position_limit_amount = 2 excludes all RBs from the Flex positions. Lovely.

However the same code appears to have no effect in single game mode. Is there a fix for this?

Thank you!

@Denwen12
Copy link

Denwen12 commented Sep 14, 2024 via email

@Denwen12
Copy link

Denwen12 commented Sep 14, 2024 via email

@Denwen12
Copy link

Denwen12 commented Sep 14, 2024 via email

@EdCarGoes
Copy link

Incredibly helpful! Thank you! I will do some testing and see if I can get this working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants