Spaces:
Running
Running
James McCool
commited on
Commit
·
f374e83
1
Parent(s):
f6ecd24
Refactor player ROO display logic in app.py by eliminating try-except blocks and directly dropping unnecessary columns based on slate type, improving code clarity and maintaining functionality.
Browse files
app.py
CHANGED
@@ -322,16 +322,13 @@ with tab2:
|
|
322 |
if team_select2:
|
323 |
player_roo_raw = player_roo_raw[player_roo_raw['Team'].isin(team_select2)]
|
324 |
|
|
|
|
|
325 |
if slate_type_var2 == 'Regular':
|
326 |
-
|
327 |
-
player_roo_disp = player_roo_raw.drop(columns=['Site', 'Slate', 'pos_group', 'timestamp', 'player_ID'])
|
328 |
-
except:
|
329 |
-
player_roo_disp = player_roo_raw
|
330 |
elif slate_type_var2 == 'Showdown':
|
331 |
-
|
332 |
-
|
333 |
-
except:
|
334 |
-
player_roo_disp = player_roo_raw
|
335 |
if view_var == "Simple":
|
336 |
try:
|
337 |
player_roo_disp = player_roo_disp[['Player', 'Position', 'Salary', 'Median', 'Ceiling', 'Own']]
|
|
|
322 |
if team_select2:
|
323 |
player_roo_raw = player_roo_raw[player_roo_raw['Team'].isin(team_select2)]
|
324 |
|
325 |
+
player_roo_disp = player_roo_raw
|
326 |
+
|
327 |
if slate_type_var2 == 'Regular':
|
328 |
+
player_roo_disp = player_roo_disp.drop(columns=['Site', 'Slate', 'pos_group', 'timestamp', 'player_ID'])
|
|
|
|
|
|
|
329 |
elif slate_type_var2 == 'Showdown':
|
330 |
+
player_roo_disp = player_roo_disp.drop(columns=['site', 'slate', 'version', 'timestamp'])
|
331 |
+
|
|
|
|
|
332 |
if view_var == "Simple":
|
333 |
try:
|
334 |
player_roo_disp = player_roo_disp[['Player', 'Position', 'Salary', 'Median', 'Ceiling', 'Own']]
|