Jon Solow commited on
Commit
4fbbbf8
·
1 Parent(s): 9ca89ad

Make more columns toggle with advanced view

Browse files
Files changed (1) hide show
  1. src/pages/1_Keepers.py +26 -12
src/pages/1_Keepers.py CHANGED
@@ -49,28 +49,42 @@ def filtered_keeper_dataframe(data: pd.DataFrame, teams_list: list[str]):
49
  teams_selected = st.multiselect("Team:", teams_list)
50
  teams_filter = data["team_name"].isin(teams_selected) if teams_selected else data["team_name"].isin(teams_list)
51
 
52
- show_columns = [
 
 
53
  "team_name",
54
  "headshot_url",
55
  "name",
 
 
 
56
  "team",
57
  "position",
 
 
 
58
  "keeper_cost",
59
- "years_eligible",
60
  "eligible",
61
  ]
62
 
63
- is_advanced = st.checkbox("Show Advanced View")
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  if is_advanced:
65
- show_columns.extend(
66
- [
67
- "ecr_1qb",
68
- "value_1qb",
69
- "ecr_2qb",
70
- "value_2qb",
71
- "ecr_pos",
72
- ]
73
- )
74
 
75
  filtered_data = filter_dataframe(data.loc[teams_filter, show_columns])
76
  st.dataframe(
 
49
  teams_selected = st.multiselect("Team:", teams_list)
50
  teams_filter = data["team_name"].isin(teams_selected) if teams_selected else data["team_name"].isin(teams_list)
51
 
52
+ is_advanced = st.checkbox("Show Advanced View")
53
+
54
+ id_cols = [
55
  "team_name",
56
  "headshot_url",
57
  "name",
58
+ ]
59
+
60
+ id_cols_advanced = [
61
  "team",
62
  "position",
63
+ ]
64
+
65
+ cost_cols = [
66
  "keeper_cost",
 
67
  "eligible",
68
  ]
69
 
70
+ cost_cols_advanced = [
71
+ "years_eligible",
72
+ ]
73
+
74
+ adp_cols: list[str] = []
75
+
76
+ adp_cols_advanced = [
77
+ "ecr_1qb",
78
+ "value_1qb",
79
+ "ecr_2qb",
80
+ "value_2qb",
81
+ "ecr_pos",
82
+ ]
83
+
84
  if is_advanced:
85
+ show_columns = id_cols + id_cols_advanced + cost_cols + cost_cols_advanced + adp_cols + adp_cols_advanced
86
+ else:
87
+ show_columns = id_cols + cost_cols + adp_cols
 
 
 
 
 
 
88
 
89
  filtered_data = filter_dataframe(data.loc[teams_filter, show_columns])
90
  st.dataframe(