Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -520,29 +520,29 @@ with tab1:
|
|
| 520 |
summary_df = pd.DataFrame({
|
| 521 |
'Metric': ['Min', 'Average', 'Max'],
|
| 522 |
'Salary': [
|
| 523 |
-
|
| 524 |
-
|
| 525 |
-
|
| 526 |
],
|
| 527 |
'Proj': [
|
| 528 |
-
|
| 529 |
-
|
| 530 |
-
|
| 531 |
],
|
| 532 |
'Own': [
|
| 533 |
-
|
| 534 |
-
|
| 535 |
-
|
| 536 |
],
|
| 537 |
'Fantasy': [
|
| 538 |
-
|
| 539 |
-
|
| 540 |
-
|
| 541 |
],
|
| 542 |
'GPP_Proj': [
|
| 543 |
-
|
| 544 |
-
|
| 545 |
-
|
| 546 |
]
|
| 547 |
})
|
| 548 |
|
|
@@ -557,17 +557,17 @@ with tab1:
|
|
| 557 |
'Fantasy': '{:.2f}',
|
| 558 |
'GPP_Proj': '{:.2f}'
|
| 559 |
}).background_gradient(cmap='RdYlGn', axis=0, subset=['Salary', 'Proj', 'Own', 'Fantasy', 'GPP_Proj']), use_container_width=True)
|
| 560 |
-
|
| 561 |
with tab2:
|
| 562 |
if 'Sim_Winner_Display' in st.session_state:
|
| 563 |
# Apply position mapping to FLEX column
|
| 564 |
-
flex_positions =
|
| 565 |
|
| 566 |
# Count occurrences of each position in FLEX
|
| 567 |
flex_counts = flex_positions.value_counts()
|
| 568 |
|
| 569 |
# Calculate average statistics for each FLEX position
|
| 570 |
-
flex_stats =
|
| 571 |
'proj': 'mean',
|
| 572 |
'Own': 'mean',
|
| 573 |
'Fantasy': 'mean',
|
|
|
|
| 520 |
summary_df = pd.DataFrame({
|
| 521 |
'Metric': ['Min', 'Average', 'Max'],
|
| 522 |
'Salary': [
|
| 523 |
+
freq_copy['salary'].min(),
|
| 524 |
+
freq_copy['salary'].mean(),
|
| 525 |
+
freq_copy['salary'].max()
|
| 526 |
],
|
| 527 |
'Proj': [
|
| 528 |
+
freq_copy['proj'].min(),
|
| 529 |
+
freq_copy['proj'].mean(),
|
| 530 |
+
freq_copy['proj'].max()
|
| 531 |
],
|
| 532 |
'Own': [
|
| 533 |
+
freq_copy['Own'].min(),
|
| 534 |
+
freq_copy['Own'].mean(),
|
| 535 |
+
freq_copy['Own'].max()
|
| 536 |
],
|
| 537 |
'Fantasy': [
|
| 538 |
+
freq_copy['Fantasy'].min(),
|
| 539 |
+
freq_copy['Fantasy'].mean(),
|
| 540 |
+
freq_copy['Fantasy'].max()
|
| 541 |
],
|
| 542 |
'GPP_Proj': [
|
| 543 |
+
freq_copy['GPP_Proj'].min(),
|
| 544 |
+
freq_copy['GPP_Proj'].mean(),
|
| 545 |
+
freq_copy['GPP_Proj'].max()
|
| 546 |
]
|
| 547 |
})
|
| 548 |
|
|
|
|
| 557 |
'Fantasy': '{:.2f}',
|
| 558 |
'GPP_Proj': '{:.2f}'
|
| 559 |
}).background_gradient(cmap='RdYlGn', axis=0, subset=['Salary', 'Proj', 'Own', 'Fantasy', 'GPP_Proj']), use_container_width=True)
|
| 560 |
+
|
| 561 |
with tab2:
|
| 562 |
if 'Sim_Winner_Display' in st.session_state:
|
| 563 |
# Apply position mapping to FLEX column
|
| 564 |
+
flex_positions = freq_copy['FLEX'].map(maps_dict['Pos_map'])
|
| 565 |
|
| 566 |
# Count occurrences of each position in FLEX
|
| 567 |
flex_counts = flex_positions.value_counts()
|
| 568 |
|
| 569 |
# Calculate average statistics for each FLEX position
|
| 570 |
+
flex_stats = freq_copy.groupby(flex_positions).agg({
|
| 571 |
'proj': 'mean',
|
| 572 |
'Own': 'mean',
|
| 573 |
'Fantasy': 'mean',
|