Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -182,3 +182,40 @@ with tab1:
|
|
| 182 |
file_name='NFL_Research_export.csv',
|
| 183 |
mime='text/csv',
|
| 184 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
file_name='NFL_Research_export.csv',
|
| 183 |
mime='text/csv',
|
| 184 |
)
|
| 185 |
+
with tab2:
|
| 186 |
+
col1, col2 = st.columns([1, 8])
|
| 187 |
+
|
| 188 |
+
with col1:
|
| 189 |
+
if st.button("Load/Reset Data", key='reset1'):
|
| 190 |
+
st.cache_data.clear()
|
| 191 |
+
rb_search = rb_util_season()
|
| 192 |
+
wr_search = wr_te_util_season()
|
| 193 |
+
macro_data = macro_pull()
|
| 194 |
+
stat_type_var2 = st.radio("What table are you loading?", ('WR/TE Coverage Matchups', 'Nothing idk lol'))
|
| 195 |
+
split_var2 = st.radio("Are you running the the whole league or certain teams?", ('All Teams', 'Specific Teams'))
|
| 196 |
+
pos_split2 = st.radio("Are you viewing all positions or specific positions?", ('All Positions', 'Specific Positions'))
|
| 197 |
+
if pos_split2 == 'Specific Positions':
|
| 198 |
+
pos_var2 = st.multiselect('What Positions would you like to view?', options = ['RB', 'WR', 'TE'])
|
| 199 |
+
elif pos_split2 == 'All Positions':
|
| 200 |
+
pos_var2 = pos_list
|
| 201 |
+
if split_var2 == 'Specific Teams':
|
| 202 |
+
team_var2 = st.multiselect('Which teams would you like to include in the Table?', options = rb_search['Team-Season'].unique())
|
| 203 |
+
elif split_var2 == 'All Teams':
|
| 204 |
+
team_var2 = rb_search['Team-Season'].unique().tolist()
|
| 205 |
+
if stat_type_var2 == 'WR/TE Coverage Matchups':
|
| 206 |
+
slate_table_instance = macro_data
|
| 207 |
+
slate_table_instance = slate_table_instance.set_index('team')
|
| 208 |
+
elif stat_type_var1 == 'Nothing idk lol':
|
| 209 |
+
slate_table_instance = 'Same bro vibes are immaculaet tho'
|
| 210 |
+
|
| 211 |
+
with col2:
|
| 212 |
+
if stat_type_var2 == 'WR/TE Coverage Matchups':
|
| 213 |
+
st.dataframe(slate_table_instance.style.background_gradient(axis=0).background_gradient(cmap = 'RdYlGn').format(precision=2), use_container_width = True)
|
| 214 |
+
elif stat_type_var2 == 'Nothing idk lol':
|
| 215 |
+
st.write(slate_table_instance)
|
| 216 |
+
st.download_button(
|
| 217 |
+
label="Export Tables",
|
| 218 |
+
data=convert_df_to_csv(slate_table_instance),
|
| 219 |
+
file_name='NFL_Slate_Research_export.csv',
|
| 220 |
+
mime='text/csv',
|
| 221 |
+
)
|