Spaces:
Sleeping
Sleeping
James McCool commited on
Commit ·
edd8d5b
1
Parent(s): d2882a7
Refactor VORP calculation in Streamlit app to use correct player values for halfPPR and custom rankings, improving accuracy in evaluations and ensuring consistency in output structure.
Browse files- src/streamlit_app.py +3 -3
src/streamlit_app.py
CHANGED
|
@@ -382,8 +382,8 @@ def assign_vorp(frame: pd.DataFrame, halfPpr_rv: dict, custom_rv: dict, league_s
|
|
| 382 |
|
| 383 |
pos_frame['halfPpr_rv'] = halfPpr_rv[positions]
|
| 384 |
pos_frame['custom_rv'] = custom_rv[positions]
|
| 385 |
-
pos_frame['halfPpr_VORP'] = pos_frame['
|
| 386 |
-
pos_frame['custom_VORP'] = pos_frame[
|
| 387 |
|
| 388 |
pos_frame = pos_frame.drop(columns=['custom_rank_raw', 'custom_calc', 'custom_proj_rank', 'max_halfPpr', 'halfPpr_range', 'max_custom', 'custom_range'])
|
| 389 |
|
|
@@ -430,7 +430,7 @@ def main():
|
|
| 430 |
# Calculate VORP and rankings
|
| 431 |
final_df, pos_lock_dict, name_lock_dict = assign_vorp(position_df, halfPpr_rv, custom_rv, user_league_settings, user_pos_vorp_limiters)
|
| 432 |
final_df = final_df.drop(columns=['SR_ID'], axis=1)
|
| 433 |
-
final_df['
|
| 434 |
final_df['pos_lock_name'] = final_df['pos_designation'].map(pos_lock_dict)
|
| 435 |
|
| 436 |
# Display results
|
|
|
|
| 382 |
|
| 383 |
pos_frame['halfPpr_rv'] = halfPpr_rv[positions]
|
| 384 |
pos_frame['custom_rv'] = custom_rv[positions]
|
| 385 |
+
pos_frame['halfPpr_VORP'] = pos_frame['halfPpr'] - halfPpr_rv[positions]
|
| 386 |
+
pos_frame['custom_VORP'] = pos_frame[rv_type] - custom_rv[positions]
|
| 387 |
|
| 388 |
pos_frame = pos_frame.drop(columns=['custom_rank_raw', 'custom_calc', 'custom_proj_rank', 'max_halfPpr', 'halfPpr_range', 'max_custom', 'custom_range'])
|
| 389 |
|
|
|
|
| 430 |
# Calculate VORP and rankings
|
| 431 |
final_df, pos_lock_dict, name_lock_dict = assign_vorp(position_df, halfPpr_rv, custom_rv, user_league_settings, user_pos_vorp_limiters)
|
| 432 |
final_df = final_df.drop(columns=['SR_ID'], axis=1)
|
| 433 |
+
final_df['orig_rank'] = final_df['Name'].map(name_lock_dict)
|
| 434 |
final_df['pos_lock_name'] = final_df['pos_designation'].map(pos_lock_dict)
|
| 435 |
|
| 436 |
# Display results
|