Answers for "export optimized lineups DFS Python"

0

export optimized lineups DFS Python

from pydfs_lineup_optimizer import get_optimizer, Site, Sport, CSVLineupExporter

optimizer = get_optimizer(Site.DRAFTKINGS, Sport.BASKETBALL)
optimizer.load_players_from_csv("players.csv")

# if you want to see lineups on screen
for lineup in optimizer.optimize(10):
    print(lineup)
optimizer.export('result.csv')

# if you don't need to see lineups on screen
lineups = list(optimizer.optimize(10))
optimizer.export('result.csv')
Posted by: Guest on July-29-2021

Browse Popular Code Answers by Language