Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -243,6 +243,12 @@ with tab1:
|
|
| 243 |
season_long_table = seasonlong_build(working_data)
|
| 244 |
season_long_table = season_long_table.set_index('Player')
|
| 245 |
display.dataframe(season_long_table.style.format(precision=2), height=750, use_container_width = True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 246 |
|
| 247 |
elif split_var1 == 'Gamelogs':
|
| 248 |
working_data = working_data[working_data['Date'] >= low_date]
|
|
@@ -271,6 +277,12 @@ with tab1:
|
|
| 271 |
pages = split_frame(working_data, batch_size)
|
| 272 |
# pages = pages.set_index('Player')
|
| 273 |
display.dataframe(data=pages[current_page - 1].style.format(precision=2), height=500, use_container_width=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 274 |
|
| 275 |
with tab2:
|
| 276 |
col1, col2 = st.columns([1, 9])
|
|
@@ -337,6 +349,12 @@ with tab2:
|
|
| 337 |
elif corr_var == 'Minutes':
|
| 338 |
corr_display = run_min_corr(working_data)
|
| 339 |
display.dataframe(corr_display.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 340 |
|
| 341 |
with tab3:
|
| 342 |
col1, col2 = st.columns([1, 9])
|
|
@@ -390,4 +408,10 @@ with tab3:
|
|
| 390 |
display = st.container()
|
| 391 |
|
| 392 |
# pages = pages.set_index('Player')
|
| 393 |
-
display.dataframe(gamelog_display.style.format(precision=2), height=500, use_container_width=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 243 |
season_long_table = seasonlong_build(working_data)
|
| 244 |
season_long_table = season_long_table.set_index('Player')
|
| 245 |
display.dataframe(season_long_table.style.format(precision=2), height=750, use_container_width = True)
|
| 246 |
+
st.download_button(
|
| 247 |
+
label="Export seasonlogs Model",
|
| 248 |
+
data=convert_df_to_csv(season_long_table),
|
| 249 |
+
file_name='Seasonlogs_NBA_View.csv',
|
| 250 |
+
mime='text/csv',
|
| 251 |
+
)
|
| 252 |
|
| 253 |
elif split_var1 == 'Gamelogs':
|
| 254 |
working_data = working_data[working_data['Date'] >= low_date]
|
|
|
|
| 277 |
pages = split_frame(working_data, batch_size)
|
| 278 |
# pages = pages.set_index('Player')
|
| 279 |
display.dataframe(data=pages[current_page - 1].style.format(precision=2), height=500, use_container_width=True)
|
| 280 |
+
st.download_button(
|
| 281 |
+
label="Export gamelogs Model",
|
| 282 |
+
data=convert_df_to_csv(working_data),
|
| 283 |
+
file_name='Gamelogs_NBA_View.csv',
|
| 284 |
+
mime='text/csv',
|
| 285 |
+
)
|
| 286 |
|
| 287 |
with tab2:
|
| 288 |
col1, col2 = st.columns([1, 9])
|
|
|
|
| 349 |
elif corr_var == 'Minutes':
|
| 350 |
corr_display = run_min_corr(working_data)
|
| 351 |
display.dataframe(corr_display.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
|
| 352 |
+
st.download_button(
|
| 353 |
+
label="Export Correlations Model",
|
| 354 |
+
data=convert_df_to_csv(corr_display),
|
| 355 |
+
file_name='Correlations_NBA_View.csv',
|
| 356 |
+
mime='text/csv',
|
| 357 |
+
)
|
| 358 |
|
| 359 |
with tab3:
|
| 360 |
col1, col2 = st.columns([1, 9])
|
|
|
|
| 408 |
display = st.container()
|
| 409 |
|
| 410 |
# pages = pages.set_index('Player')
|
| 411 |
+
display.dataframe(gamelog_display.style.format(precision=2), height=500, use_container_width=True)
|
| 412 |
+
st.download_button(
|
| 413 |
+
label="Export Matchups Model",
|
| 414 |
+
data=convert_df_to_csv(gamelog_display),
|
| 415 |
+
file_name='Matchups_NBA_View.csv',
|
| 416 |
+
mime='text/csv',
|
| 417 |
+
)
|