DFSNBA_Team_Builder
YOUTUBE GUIDE
Install
pip install DFSNBA-TeamBuilder
Pandas is needed to import and export the offical draftkings file
import pandas as pd
##This is the actual package that you just downloaded
import DFS_NBA_Team_Builder
from DFS_NBA_Team_Builder import DK_TeamBuilder
Set the variables
Import the draftkings file
dfr=pd.read_csv("ExampleDKFile.csv")#This is the example file from GitHub
Set how many players you want to sample
1 is no sampling 0 remove alls players .20 leaves you 20% of the players #from the dk file
samplepercent= .20
How many teams do you want to create
dkteams =20
Use this exact function to call and create you lineups
playerusage, dkupload= DFS_NBA_Team_Builder.DK_TeamBuilder.DK_TeamBuildermod(dfr,dkteams,samplepercent)
This gives you a breakdown of how often you use players you many choose
to resample if you dont like how it looks
playerusage.head()
ID | AvgPointsPerGame | |
---|---|---|
Name | ||
J.J. Barea | 12 | 23.26 |
Victor Oladipo | 11 | 37.56 |
Caris LeVert | 10 | 30.72 |
Tim Hardaway Jr. | 7 | 29.48 |
Blake Griffin | 7 | 46.60 |
This is the file that you actually upload into the draftkings website
dkupload.to_csv("DkTeamsUpload.csv")
Purpose
Create optimized NBA draftkings lineups with sampling
What to do high level
1.Import Draftkings Upload File DK_Upload_Page
2.Build a team or teams based on the amount of teams and amount of sampling you want
3.Use Linear Programming to optimze the teams for the maximum amount of points while staying under the salary cap
End Notes
This package was created to use the draftkings lineup file for any given night and run an optimization function on it in order to create the most efficient teams based on the average points columns.