James McCool commited on
Commit
0ea4aed
·
1 Parent(s): 3c310fe

Refactor rank adjustment calculations in Streamlit app to utilize position-specific VORP limiters directly, improving accuracy in player ranking adjustments for QB, RB, WR, and TE positions.

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +1 -1
src/streamlit_app.py CHANGED
@@ -375,7 +375,7 @@ def assign_vorp(frame: pd.DataFrame, halfPpr_rv: dict, custom_rv: dict, league_s
375
  vorp_frame['custom_vorp_rank'] = vorp_frame['custom_VORP'].rank(method='max', ascending=False)
376
  vorp_frame['vorp_diff'] = vorp_frame['halfPpr_vorp_rank'] - vorp_frame['custom_vorp_rank']
377
  for positions in ['QB', 'RB', 'WR', 'TE']:
378
- vorp_frame.loc[vorp_frame['Pos'] == positions, 'Rank_Adjust'] = (vorp_frame['Rank'] - (vorp_frame['vorp_diff'] * pos_vorp_limiters[league_settings['TYPE']][positions])).astype(float)
379
  vorp_frame['custom_rank'] = vorp_frame['Rank_Adjust'].rank(method='first', ascending=True)
380
 
381
  print(vorp_frame.sort_values(by='custom_vorp_rank', ascending=True).head(50))
 
375
  vorp_frame['custom_vorp_rank'] = vorp_frame['custom_VORP'].rank(method='max', ascending=False)
376
  vorp_frame['vorp_diff'] = vorp_frame['halfPpr_vorp_rank'] - vorp_frame['custom_vorp_rank']
377
  for positions in ['QB', 'RB', 'WR', 'TE']:
378
+ vorp_frame.loc[vorp_frame['Pos'] == positions, 'Rank_Adjust'] = (vorp_frame['Rank'] - (vorp_frame['vorp_diff'] * pos_vorp_limiters[positions])).astype(float)
379
  vorp_frame['custom_rank'] = vorp_frame['Rank_Adjust'].rank(method='first', ascending=True)
380
 
381
  print(vorp_frame.sort_values(by='custom_vorp_rank', ascending=True).head(50))