Spaces:
Running
Running
James McCool
commited on
Commit
·
d4ac8fa
1
Parent(s):
4cc5bac
Update 'Stack Finder' tab to adjust stack size handling and enhance combination DataFrame with team, projection, salary, and ownership percentage calculations in Streamlit app
Browse files- src/streamlit_app.py +13 -6
src/streamlit_app.py
CHANGED
|
@@ -216,7 +216,6 @@ if selected_tab == 'Stack Finder':
|
|
| 216 |
'TE': 1,
|
| 217 |
'UTIL': 1,
|
| 218 |
'DST': 1,
|
| 219 |
-
# Add more as needed
|
| 220 |
}
|
| 221 |
max_salary = max_sal2
|
| 222 |
max_players = 9
|
|
@@ -228,7 +227,6 @@ if selected_tab == 'Stack Finder':
|
|
| 228 |
'TE': 1,
|
| 229 |
'UTIL': 1,
|
| 230 |
'DST': 1,
|
| 231 |
-
# Add more as needed
|
| 232 |
}
|
| 233 |
max_salary = max_sal2
|
| 234 |
max_players = 9
|
|
@@ -248,8 +246,7 @@ if selected_tab == 'Stack Finder':
|
|
| 248 |
for player in combo:
|
| 249 |
# Get their eligible positions
|
| 250 |
player_positions = pos_dict[player].split('/')
|
| 251 |
-
|
| 252 |
-
# For each position they can play
|
| 253 |
for pos in player_positions:
|
| 254 |
position_counts[pos] += 1
|
| 255 |
|
|
@@ -276,14 +273,24 @@ if selected_tab == 'Stack Finder':
|
|
| 276 |
if qb_var in i:
|
| 277 |
comb_list.append(i)
|
| 278 |
|
| 279 |
-
# Only add combinations that satisfy position limits
|
| 280 |
for i in list(comb):
|
| 281 |
if is_valid_combination(i):
|
| 282 |
comb_list.append(i)
|
| 283 |
|
| 284 |
comb_DF = pd.DataFrame(comb_list)
|
| 285 |
|
| 286 |
-
if stack_size ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 287 |
comb_DF['Team'] = comb_DF[0].map(team_dict)
|
| 288 |
|
| 289 |
comb_DF['Proj'] = sum([comb_DF[0].map(proj_dict),
|
|
|
|
| 216 |
'TE': 1,
|
| 217 |
'UTIL': 1,
|
| 218 |
'DST': 1,
|
|
|
|
| 219 |
}
|
| 220 |
max_salary = max_sal2
|
| 221 |
max_players = 9
|
|
|
|
| 227 |
'TE': 1,
|
| 228 |
'UTIL': 1,
|
| 229 |
'DST': 1,
|
|
|
|
| 230 |
}
|
| 231 |
max_salary = max_sal2
|
| 232 |
max_players = 9
|
|
|
|
| 246 |
for player in combo:
|
| 247 |
# Get their eligible positions
|
| 248 |
player_positions = pos_dict[player].split('/')
|
| 249 |
+
|
|
|
|
| 250 |
for pos in player_positions:
|
| 251 |
position_counts[pos] += 1
|
| 252 |
|
|
|
|
| 273 |
if qb_var in i:
|
| 274 |
comb_list.append(i)
|
| 275 |
|
|
|
|
| 276 |
for i in list(comb):
|
| 277 |
if is_valid_combination(i):
|
| 278 |
comb_list.append(i)
|
| 279 |
|
| 280 |
comb_DF = pd.DataFrame(comb_list)
|
| 281 |
|
| 282 |
+
if stack_size == 2:
|
| 283 |
+
comb_DF['Team'] = comb_DF[0].map(team_dict)
|
| 284 |
+
|
| 285 |
+
comb_DF['Proj'] = sum([comb_DF[0].map(proj_dict),
|
| 286 |
+
comb_DF[1].map(proj_dict)])
|
| 287 |
+
|
| 288 |
+
comb_DF['Salary'] = sum([comb_DF[0].map(cost_dict),
|
| 289 |
+
comb_DF[1].map(cost_dict)])
|
| 290 |
+
|
| 291 |
+
comb_DF['Own%'] = sum([comb_DF[0].map(own_dict),
|
| 292 |
+
comb_DF[1].map(own_dict)])
|
| 293 |
+
elif stack_size == 3:
|
| 294 |
comb_DF['Team'] = comb_DF[0].map(team_dict)
|
| 295 |
|
| 296 |
comb_DF['Proj'] = sum([comb_DF[0].map(proj_dict),
|