Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -50,8 +50,7 @@ def init_baselines():
|
|
| 50 |
raw_display = raw_display.reset_index(drop=True)
|
| 51 |
matchups = raw_display[raw_display['Opp'] != ""]
|
| 52 |
data_cols = matchups.columns.drop(['Team', 'Opp'])
|
| 53 |
-
matchups[data_cols] = matchups[data_cols].apply(pd.to_numeric, errors='coerce')
|
| 54 |
-
matchups_dict = dict(zip(matchups['Team'], matchups['Opp']))
|
| 55 |
|
| 56 |
worksheet = sh.worksheet('Marketshares')
|
| 57 |
raw_display = pd.DataFrame(worksheet.get_values())
|
|
@@ -62,20 +61,20 @@ def init_baselines():
|
|
| 62 |
overall_ms = raw_display[['Line', 'SK1', 'SK2', 'SK3', 'Cost', 'Team Total', 'Shots', 'HDCF', 'Goals', 'Assists', 'Blocks',
|
| 63 |
'L14_Shots', 'L14_HDCF', 'L14_Goals', 'L14_Assists', 'L14_Blocks']]
|
| 64 |
data_cols = overall_ms.columns.drop(['Line', 'SK1', 'SK2', 'SK3'])
|
| 65 |
-
overall_ms[data_cols] = overall_ms[data_cols].apply(pd.to_numeric, errors='coerce')
|
| 66 |
|
| 67 |
-
return matchups,
|
| 68 |
|
| 69 |
def convert_df_to_csv(df):
|
| 70 |
return df.to_csv().encode('utf-8')
|
| 71 |
|
| 72 |
-
matchups,
|
| 73 |
|
| 74 |
col1, col2 = st.columns([1, 9])
|
| 75 |
with col1:
|
| 76 |
if st.button("Reset Data", key='reset1'):
|
| 77 |
st.cache_data.clear()
|
| 78 |
-
matchups,
|
| 79 |
split_var1 = st.radio("View matchups or line marketshares?", ('Slate Matchups', 'Line Marketshares'), key='split_var1')
|
| 80 |
|
| 81 |
with col2:
|
|
|
|
| 50 |
raw_display = raw_display.reset_index(drop=True)
|
| 51 |
matchups = raw_display[raw_display['Opp'] != ""]
|
| 52 |
data_cols = matchups.columns.drop(['Team', 'Opp'])
|
| 53 |
+
# matchups[data_cols] = matchups[data_cols].apply(pd.to_numeric, errors='coerce')
|
|
|
|
| 54 |
|
| 55 |
worksheet = sh.worksheet('Marketshares')
|
| 56 |
raw_display = pd.DataFrame(worksheet.get_values())
|
|
|
|
| 61 |
overall_ms = raw_display[['Line', 'SK1', 'SK2', 'SK3', 'Cost', 'Team Total', 'Shots', 'HDCF', 'Goals', 'Assists', 'Blocks',
|
| 62 |
'L14_Shots', 'L14_HDCF', 'L14_Goals', 'L14_Assists', 'L14_Blocks']]
|
| 63 |
data_cols = overall_ms.columns.drop(['Line', 'SK1', 'SK2', 'SK3'])
|
| 64 |
+
# overall_ms[data_cols] = overall_ms[data_cols].apply(pd.to_numeric, errors='coerce')
|
| 65 |
|
| 66 |
+
return matchups, overall_ms
|
| 67 |
|
| 68 |
def convert_df_to_csv(df):
|
| 69 |
return df.to_csv().encode('utf-8')
|
| 70 |
|
| 71 |
+
matchups, overall_ms = init_baselines()
|
| 72 |
|
| 73 |
col1, col2 = st.columns([1, 9])
|
| 74 |
with col1:
|
| 75 |
if st.button("Reset Data", key='reset1'):
|
| 76 |
st.cache_data.clear()
|
| 77 |
+
matchups, overall_ms = init_baselines()
|
| 78 |
split_var1 = st.radio("View matchups or line marketshares?", ('Slate Matchups', 'Line Marketshares'), key='split_var1')
|
| 79 |
|
| 80 |
with col2:
|