Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -138,8 +138,8 @@ with tab2:
|
|
138 |
min_sal1 = st.number_input('Min Salary', min_value = 35000, max_value = 49900, value = 49000, step = 100, key='min_sal1')
|
139 |
max_sal1 = st.number_input('Max Salary', min_value = 35000, max_value = 50000, value = 50000, step = 100, key='max_sal1')
|
140 |
elif site_var1 == 'Fanduel':
|
141 |
-
min_sal1 = st.number_input('Min Salary', min_value = 45000, max_value =
|
142 |
-
max_sal1 = st.number_input('Max Salary', min_value = 45000, max_value =
|
143 |
with col2:
|
144 |
raw_baselines = raw_baselines[raw_baselines['Team'].isin(team_var1)]
|
145 |
raw_baselines = raw_baselines[~raw_baselines['Player'].isin(avoid_var1)]
|
@@ -394,13 +394,13 @@ with tab2:
|
|
394 |
p_used.extend(sorted_lineup)
|
395 |
|
396 |
for pname in range(0,len(line_hold)):
|
397 |
-
if line_hold.iat[pname,1]
|
398 |
if line_hold.iat[pname,0] not in p_used:
|
399 |
sorted_lineup.append(line_hold.iat[pname,0])
|
400 |
p_used.extend(sorted_lineup)
|
401 |
|
402 |
for pname in range(0,len(line_hold)):
|
403 |
-
if line_hold.iat[pname,1]
|
404 |
if line_hold.iat[pname,0] not in p_used:
|
405 |
sorted_lineup.append(line_hold.iat[pname,0])
|
406 |
p_used.extend(sorted_lineup)
|
@@ -491,7 +491,7 @@ with tab2:
|
|
491 |
x += 1
|
492 |
|
493 |
if site_var1 == 'Draftkings':
|
494 |
-
portfolio.rename(columns={0: "C1", 1: "C2", 2: "W1", 3: "W2", 4: "W3", 5: "D1", 6: "D2", 7: "
|
495 |
elif site_var1 == 'Fanduel':
|
496 |
portfolio.rename(columns={0: "C1", 1: "C2", 2: "W1", 3: "W2", 4: "D1", 5: "D2", 6: "UTIL1", 7: "UTIL2", 8: "G"}, inplace = True)
|
497 |
portfolio = portfolio.dropna()
|
@@ -502,7 +502,7 @@ with tab2:
|
|
502 |
portfolio = portfolio.drop(columns=['index'])
|
503 |
|
504 |
if site_var1 == 'Draftkings':
|
505 |
-
final_outcomes = portfolio[['C1', 'C2', 'W1', 'W2', 'W3', 'D1', 'D2', '
|
506 |
|
507 |
final_outcomes_export = pd.DataFrame()
|
508 |
final_outcomes_export['C1'] = final_outcomes['C1']
|
@@ -512,8 +512,8 @@ with tab2:
|
|
512 |
final_outcomes_export['W3'] = final_outcomes['W3']
|
513 |
final_outcomes_export['D1'] = final_outcomes['D1']
|
514 |
final_outcomes_export['D2'] = final_outcomes['D2']
|
515 |
-
final_outcomes_export['UTIL'] = final_outcomes['UTIL']
|
516 |
final_outcomes_export['G'] = final_outcomes['G']
|
|
|
517 |
final_outcomes_export['Salary'] = final_outcomes['Cost']
|
518 |
final_outcomes_export['Own'] = final_outcomes['Own']
|
519 |
final_outcomes_export['Proj'] = final_outcomes['Proj']
|
@@ -525,8 +525,8 @@ with tab2:
|
|
525 |
final_outcomes_export['W3'].replace(dkid_dict, inplace=True)
|
526 |
final_outcomes_export['D1'].replace(dkid_dict, inplace=True)
|
527 |
final_outcomes_export['D2'].replace(dkid_dict, inplace=True)
|
528 |
-
final_outcomes_export['UTIL'].replace(dkid_dict, inplace=True)
|
529 |
final_outcomes_export['G'].replace(dkid_dict, inplace=True)
|
|
|
530 |
elif site_var1 == 'Fanduel':
|
531 |
final_outcomes = portfolio[['C1', 'C2', 'W1', 'W2', 'D1', 'D2', 'UTIL1', 'UTIL2', 'G', 'Cost', 'Proj', 'Own']]
|
532 |
|
|
|
138 |
min_sal1 = st.number_input('Min Salary', min_value = 35000, max_value = 49900, value = 49000, step = 100, key='min_sal1')
|
139 |
max_sal1 = st.number_input('Max Salary', min_value = 35000, max_value = 50000, value = 50000, step = 100, key='max_sal1')
|
140 |
elif site_var1 == 'Fanduel':
|
141 |
+
min_sal1 = st.number_input('Min Salary', min_value = 45000, max_value = 54900, value = 54000, step = 100, key='min_sal1')
|
142 |
+
max_sal1 = st.number_input('Max Salary', min_value = 45000, max_value = 55000, value = 55000, step = 100, key='max_sal1')
|
143 |
with col2:
|
144 |
raw_baselines = raw_baselines[raw_baselines['Team'].isin(team_var1)]
|
145 |
raw_baselines = raw_baselines[~raw_baselines['Player'].isin(avoid_var1)]
|
|
|
394 |
p_used.extend(sorted_lineup)
|
395 |
|
396 |
for pname in range(0,len(line_hold)):
|
397 |
+
if line_hold.iat[pname,1] == 'G':
|
398 |
if line_hold.iat[pname,0] not in p_used:
|
399 |
sorted_lineup.append(line_hold.iat[pname,0])
|
400 |
p_used.extend(sorted_lineup)
|
401 |
|
402 |
for pname in range(0,len(line_hold)):
|
403 |
+
if line_hold.iat[pname,1] != 'G':
|
404 |
if line_hold.iat[pname,0] not in p_used:
|
405 |
sorted_lineup.append(line_hold.iat[pname,0])
|
406 |
p_used.extend(sorted_lineup)
|
|
|
491 |
x += 1
|
492 |
|
493 |
if site_var1 == 'Draftkings':
|
494 |
+
portfolio.rename(columns={0: "C1", 1: "C2", 2: "W1", 3: "W2", 4: "W3", 5: "D1", 6: "D2", 7: "G", 8: "UTIL"}, inplace = True)
|
495 |
elif site_var1 == 'Fanduel':
|
496 |
portfolio.rename(columns={0: "C1", 1: "C2", 2: "W1", 3: "W2", 4: "D1", 5: "D2", 6: "UTIL1", 7: "UTIL2", 8: "G"}, inplace = True)
|
497 |
portfolio = portfolio.dropna()
|
|
|
502 |
portfolio = portfolio.drop(columns=['index'])
|
503 |
|
504 |
if site_var1 == 'Draftkings':
|
505 |
+
final_outcomes = portfolio[['C1', 'C2', 'W1', 'W2', 'W3', 'D1', 'D2', 'G', 'UTIL', 'Cost', 'Proj', 'Own']]
|
506 |
|
507 |
final_outcomes_export = pd.DataFrame()
|
508 |
final_outcomes_export['C1'] = final_outcomes['C1']
|
|
|
512 |
final_outcomes_export['W3'] = final_outcomes['W3']
|
513 |
final_outcomes_export['D1'] = final_outcomes['D1']
|
514 |
final_outcomes_export['D2'] = final_outcomes['D2']
|
|
|
515 |
final_outcomes_export['G'] = final_outcomes['G']
|
516 |
+
final_outcomes_export['UTIL'] = final_outcomes['UTIL']
|
517 |
final_outcomes_export['Salary'] = final_outcomes['Cost']
|
518 |
final_outcomes_export['Own'] = final_outcomes['Own']
|
519 |
final_outcomes_export['Proj'] = final_outcomes['Proj']
|
|
|
525 |
final_outcomes_export['W3'].replace(dkid_dict, inplace=True)
|
526 |
final_outcomes_export['D1'].replace(dkid_dict, inplace=True)
|
527 |
final_outcomes_export['D2'].replace(dkid_dict, inplace=True)
|
|
|
528 |
final_outcomes_export['G'].replace(dkid_dict, inplace=True)
|
529 |
+
final_outcomes_export['UTIL'].replace(dkid_dict, inplace=True)
|
530 |
elif site_var1 == 'Fanduel':
|
531 |
final_outcomes = portfolio[['C1', 'C2', 'W1', 'W2', 'D1', 'D2', 'UTIL1', 'UTIL2', 'G', 'Cost', 'Proj', 'Own']]
|
532 |
|