Spaces:
Sleeping
Sleeping
James McCool commited on
Commit ·
e5086fd
1
Parent(s): ced1179
Enhance player position count displays in Streamlit app by adding percentage calculations for QB, RB, WR, and TE rankings, improving insights into player performance across different tiers.
Browse files- src/streamlit_app.py +17 -5
src/streamlit_app.py
CHANGED
|
@@ -463,19 +463,31 @@ def main():
|
|
| 463 |
# Display results
|
| 464 |
st.header("Player Rankings")
|
| 465 |
st.dataframe(final_df, use_container_width=True)
|
| 466 |
-
qb_count_col, rb_count_col, wr_count_col, te_count_col = st.columns(
|
| 467 |
with qb_count_col:
|
| 468 |
st.subheader("QB Counts")
|
| 469 |
-
st.write(f"Total QB top 12: {(final_df.loc[0:11, 'Pos'] == 'QB').sum()}")
|
|
|
|
|
|
|
|
|
|
| 470 |
with rb_count_col:
|
| 471 |
st.subheader("RB Counts")
|
| 472 |
-
st.write(f"Total RB top 12: {(final_df.loc[0:11, 'Pos'] == 'RB').sum()}")
|
|
|
|
|
|
|
|
|
|
| 473 |
with wr_count_col:
|
| 474 |
st.subheader("WR Counts")
|
| 475 |
-
st.write(f"Total WR top 12: {(final_df.loc[0:11, 'Pos'] == 'WR').sum()}")
|
|
|
|
|
|
|
|
|
|
| 476 |
with te_count_col:
|
| 477 |
st.subheader("TE Counts")
|
| 478 |
-
st.write(f"Total TE top 12: {(final_df.loc[0:11, 'Pos'] == 'TE').sum()}")
|
|
|
|
|
|
|
|
|
|
| 479 |
|
| 480 |
|
| 481 |
# Position breakdown
|
|
|
|
| 463 |
# Display results
|
| 464 |
st.header("Player Rankings")
|
| 465 |
st.dataframe(final_df, use_container_width=True)
|
| 466 |
+
blank_left, qb_count_col, rb_count_col, wr_count_col, te_count_col, blank_right = st.columns(6)
|
| 467 |
with qb_count_col:
|
| 468 |
st.subheader("QB Counts")
|
| 469 |
+
st.write(f"Total QB top 12: {(final_df.loc[0:11, 'Pos'] == 'QB').sum()}, {((final_df.loc[0:11, 'Pos'] == 'QB').sum() / 12) * 100}%")
|
| 470 |
+
st.write(f"Total QB 13 - 24: {(final_df.loc[12:23, 'Pos'] == 'QB').sum()}, {((final_df.loc[12:23, 'Pos'] == 'QB').sum() / 12) * 100}%")
|
| 471 |
+
st.write(f"Total QB 25 - 36: {(final_df.loc[24:35, 'Pos'] == 'QB').sum()}, {((final_df.loc[24:35, 'Pos'] == 'QB').sum() / 12) * 100}%")
|
| 472 |
+
st.write(f"Total QB 37 - 48: {(final_df.loc[36:47, 'Pos'] == 'QB').sum()}, {((final_df.loc[36:47, 'Pos'] == 'QB').sum() / 12) * 100}%")
|
| 473 |
with rb_count_col:
|
| 474 |
st.subheader("RB Counts")
|
| 475 |
+
st.write(f"Total RB top 12: {(final_df.loc[0:11, 'Pos'] == 'RB').sum()}, {((final_df.loc[0:11, 'Pos'] == 'RB').sum() / 12) * 100}%")
|
| 476 |
+
st.write(f"Total RB 13 - 24: {(final_df.loc[12:23, 'Pos'] == 'RB').sum()}, {((final_df.loc[12:23, 'Pos'] == 'RB').sum() / 12) * 100}%")
|
| 477 |
+
st.write(f"Total RB 25 - 36: {(final_df.loc[24:35, 'Pos'] == 'RB').sum()}, {((final_df.loc[24:35, 'Pos'] == 'RB').sum() / 12) * 100}%")
|
| 478 |
+
st.write(f"Total RB 37 - 48: {(final_df.loc[36:47, 'Pos'] == 'RB').sum()}, {((final_df.loc[36:47, 'Pos'] == 'RB').sum() / 12) * 100}%")
|
| 479 |
with wr_count_col:
|
| 480 |
st.subheader("WR Counts")
|
| 481 |
+
st.write(f"Total WR top 12: {(final_df.loc[0:11, 'Pos'] == 'WR').sum()}, {((final_df.loc[0:11, 'Pos'] == 'WR').sum() / 12) * 100}%")
|
| 482 |
+
st.write(f"Total WR 13 - 24: {(final_df.loc[12:23, 'Pos'] == 'WR').sum()}, {((final_df.loc[12:23, 'Pos'] == 'WR').sum() / 12) * 100}%")
|
| 483 |
+
st.write(f"Total WR 25 - 36: {(final_df.loc[24:35, 'Pos'] == 'WR').sum()}, {((final_df.loc[24:35, 'Pos'] == 'WR').sum() / 12) * 100}%")
|
| 484 |
+
st.write(f"Total WR 37 - 48: {(final_df.loc[36:47, 'Pos'] == 'WR').sum()}, {((final_df.loc[36:47, 'Pos'] == 'WR').sum() / 12) * 100}%")
|
| 485 |
with te_count_col:
|
| 486 |
st.subheader("TE Counts")
|
| 487 |
+
st.write(f"Total TE top 12: {(final_df.loc[0:11, 'Pos'] == 'TE').sum()}, {((final_df.loc[0:11, 'Pos'] == 'TE').sum() / 12) * 100}%")
|
| 488 |
+
st.write(f"Total TE 13 - 24: {(final_df.loc[12:23, 'Pos'] == 'TE').sum()}, {((final_df.loc[12:23, 'Pos'] == 'TE').sum() / 12) * 100}%")
|
| 489 |
+
st.write(f"Total TE 25 - 36: {(final_df.loc[24:35, 'Pos'] == 'TE').sum()}, {((final_df.loc[24:35, 'Pos'] == 'TE').sum() / 12) * 100}%")
|
| 490 |
+
st.write(f"Total TE 37 - 48: {(final_df.loc[36:47, 'Pos'] == 'TE').sum()}, {((final_df.loc[36:47, 'Pos'] == 'TE').sum() / 12) * 100}%")
|
| 491 |
|
| 492 |
|
| 493 |
# Position breakdown
|