James McCool
commited on
Commit
·
db75e00
1
Parent(s):
6b711fb
Replace dataframe display with table in app.py for improved performance and simplicity. This change enhances the user interface by streamlining the presentation of paginated data.
Browse files
app.py
CHANGED
|
@@ -1207,38 +1207,8 @@ with tab2:
|
|
| 1207 |
# Get the subset of data for the current page
|
| 1208 |
current_page_data = display_frame.iloc[start_idx:end_idx]
|
| 1209 |
# Display the paginated dataframe first
|
| 1210 |
-
st.
|
| 1211 |
-
current_page_data
|
| 1212 |
-
.background_gradient(axis=0)
|
| 1213 |
-
.background_gradient(cmap='RdYlGn')
|
| 1214 |
-
.background_gradient(cmap='RdYlGn_r', subset=['Finish_percentile', 'Own', 'Dupes'])
|
| 1215 |
-
.format(freq_format, precision=2),
|
| 1216 |
-
column_config={
|
| 1217 |
-
"Finish_percentile": st.column_config.NumberColumn(
|
| 1218 |
-
"Finish%",
|
| 1219 |
-
help="Projected finishing percentile",
|
| 1220 |
-
width="small",
|
| 1221 |
-
min_value=0.0,
|
| 1222 |
-
max_value=1.0
|
| 1223 |
-
),
|
| 1224 |
-
"Lineup Edge": st.column_config.NumberColumn(
|
| 1225 |
-
"Edge",
|
| 1226 |
-
help="Projected lineup edge",
|
| 1227 |
-
width="small",
|
| 1228 |
-
min_value=-1.0,
|
| 1229 |
-
max_value=1.0
|
| 1230 |
-
),
|
| 1231 |
-
"Diversity": st.column_config.NumberColumn(
|
| 1232 |
-
"Diversity",
|
| 1233 |
-
help="Projected lineup diversity",
|
| 1234 |
-
width="small",
|
| 1235 |
-
min_value=0.0,
|
| 1236 |
-
max_value=1.0
|
| 1237 |
-
),
|
| 1238 |
-
},
|
| 1239 |
-
height=500,
|
| 1240 |
-
use_container_width=True,
|
| 1241 |
-
hide_index=True
|
| 1242 |
)
|
| 1243 |
player_stats_col, stack_stats_col = st.tabs(['Player Stats', 'Stack Stats'])
|
| 1244 |
with player_stats_col:
|
|
|
|
| 1207 |
# Get the subset of data for the current page
|
| 1208 |
current_page_data = display_frame.iloc[start_idx:end_idx]
|
| 1209 |
# Display the paginated dataframe first
|
| 1210 |
+
st.table(
|
| 1211 |
+
current_page_data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1212 |
)
|
| 1213 |
player_stats_col, stack_stats_col = st.tabs(['Player Stats', 'Stack Stats'])
|
| 1214 |
with player_stats_col:
|