DimaKudosh / pydfs-lineup-optimizer

Daily Fantasy Sports lineup optimzer for all popular daily fantasy sports sites
MIT License
423 stars 157 forks source link

P included in TeamStack #356

Closed lightninglarry closed 2 years ago

lightninglarry commented 2 years ago

how do you not include a P into a TeamStack? if im wanting a 4-3-1 build, that is all batters. optimizer.add_stack(TeamStack(4, spacing=2, for_teams=['PHI','TOR','TB','ATL','STL'])) # stack 4 players optimizer.add_stack(TeamStack(3, spacing=1, for_teams=['LAD', 'HOU', 'COL', 'LAA', 'ATL', 'CIN', 'SD'])) # stack 3 players

it gives me 4(1 could be the P, or not) but im not getting the 3 stack . Thoughts?

kryptickevin commented 2 years ago

Change your code to the following if you want to only include batters in your stack:

optimizer.add_stack(TeamStack(4, spacing=2, for_teams=['PHI','TOR','TB','ATL','STL'], for_positions=['1B', '2B', '3B', 'SS', 'C', 'OF',])) # stack 4 players

lightninglarry commented 2 years ago

Thanks, that worked.