Spaces:
Sleeping
Sleeping
James McCool
commited on
Commit
·
253ecef
1
Parent(s):
3536cb9
Refactor VORP roster assignment in Streamlit app to improve clarity by renaming variables for halfPPR and custom lookups, ensuring accurate calculations of VORP values.
Browse files- src/streamlit_app.py +4 -4
src/streamlit_app.py
CHANGED
@@ -397,13 +397,13 @@ def assign_vorp_roster(frame: pd.DataFrame, halfPpr_rv: dict, custom_rv: dict, p
|
|
397 |
pos_frame = pos_frame.sort_values(by='Rank', ascending=True).reset_index(drop=True)
|
398 |
pos_frame['ranker_rank'] = pos_frame['Rank'].rank(method='first', ascending=True).astype(int)
|
399 |
pos_frame['pos_rank_initial'] = pos_frame['Pos'] + pos_frame['ranker_rank'].astype(str)
|
400 |
-
|
401 |
-
|
402 |
|
403 |
pos_frame['halfPpr_rv'] = halfPpr_rv[positions]
|
404 |
pos_frame['custom_rv'] = custom_rv[positions]
|
405 |
-
pos_frame['halfPpr_VORP'] = pos_frame[
|
406 |
-
pos_frame['custom_VORP'] = pos_frame[
|
407 |
|
408 |
vorp_frame = pd.concat([vorp_frame, pos_frame]).reset_index(drop=True)
|
409 |
|
|
|
397 |
pos_frame = pos_frame.sort_values(by='Rank', ascending=True).reset_index(drop=True)
|
398 |
pos_frame['ranker_rank'] = pos_frame['Rank'].rank(method='first', ascending=True).astype(int)
|
399 |
pos_frame['pos_rank_initial'] = pos_frame['Pos'] + pos_frame['ranker_rank'].astype(str)
|
400 |
+
pos_frame['halfPpr_lookup'] = pos_frame['pos_rank_initial'].map(half_ppr_match_dict)
|
401 |
+
pos_frame['custom_lookup'] = pos_frame['pos_rank_initial'].map(custom_match_dict)
|
402 |
|
403 |
pos_frame['halfPpr_rv'] = halfPpr_rv[positions]
|
404 |
pos_frame['custom_rv'] = custom_rv[positions]
|
405 |
+
pos_frame['halfPpr_VORP'] = pos_frame['halfPpr_lookup'] - pos_frame['halfPpr_rv']
|
406 |
+
pos_frame['custom_VORP'] = pos_frame['custom_lookup'] - pos_frame['custom_rv']
|
407 |
|
408 |
vorp_frame = pd.concat([vorp_frame, pos_frame]).reset_index(drop=True)
|
409 |
|