Multichem commited on
Commit
8751601
·
1 Parent(s): 1be8c76

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -77,25 +77,25 @@ def init_baselines():
77
  overall_ms[data_cols] = overall_ms[data_cols].apply(pd.to_numeric, errors='coerce')
78
  overall_ms = overall_ms.sort_values(by='Shots', ascending=False)
79
 
80
- return matchups, overall_ms, team_list, team_dict
81
 
82
  def convert_df_to_csv(df):
83
  return df.to_csv().encode('utf-8')
84
 
85
- matchups, overall_ms, team_list, team_dict = init_baselines()
86
 
87
  col1, col2 = st.columns([1, 9])
88
  with col1:
89
  if st.button("Reset Data", key='reset1'):
90
  st.cache_data.clear()
91
- matchups, overall_ms, team_list, team_dict = init_baselines()
92
  split_var1 = st.radio("View matchups or line marketshares?", ('Slate Matchups', 'Line Marketshares'), key='split_var1')
93
  if split_var1 == "Line Marketshares":
94
  team_var = st.radio("View all teams or specific teams?", ('All Teams', 'Specific Teams'), key='team_var')
95
  if team_var == "All Teams":
96
- team_split = team_list
97
  elif team_var == "Specific Teams":
98
- team_split = st.multiselect('Which teams would you like to include in the tables?', options = team_list, key='team_var1')
99
 
100
  with col2:
101
  if split_var1 == 'Slate Matchups':
 
77
  overall_ms[data_cols] = overall_ms[data_cols].apply(pd.to_numeric, errors='coerce')
78
  overall_ms = overall_ms.sort_values(by='Shots', ascending=False)
79
 
80
+ return matchups, overall_ms, team_frame, team_list, team_dict
81
 
82
  def convert_df_to_csv(df):
83
  return df.to_csv().encode('utf-8')
84
 
85
+ matchups, overall_ms, team_frame, team_list, team_dict = init_baselines()
86
 
87
  col1, col2 = st.columns([1, 9])
88
  with col1:
89
  if st.button("Reset Data", key='reset1'):
90
  st.cache_data.clear()
91
+ matchups, overall_ms, team_frame, team_list, team_dict = init_baselines()
92
  split_var1 = st.radio("View matchups or line marketshares?", ('Slate Matchups', 'Line Marketshares'), key='split_var1')
93
  if split_var1 == "Line Marketshares":
94
  team_var = st.radio("View all teams or specific teams?", ('All Teams', 'Specific Teams'), key='team_var')
95
  if team_var == "All Teams":
96
+ team_split = team_frame.Team.values.tolist()
97
  elif team_var == "Specific Teams":
98
+ team_split = st.multiselect('Which teams would you like to include in the tables?', options = team_frame['Team'].unique(), key='team_var1')
99
 
100
  with col2:
101
  if split_var1 == 'Slate Matchups':