Spaces:
Sleeping
Sleeping
James McCool
commited on
Commit
·
178e748
1
Parent(s):
6a3a743
Refactor salary calculation logic in app.py to apply a specific multiplier for NBA players, ensuring accurate salary projections based on sport selection. This change enhances the clarity and correctness of player salary mappings, particularly for NBA contests.
Browse files
app.py
CHANGED
@@ -540,9 +540,9 @@ with tab1:
|
|
540 |
cpt_working['Freq'] = cpt_working['Freq'].astype(int)
|
541 |
cpt_working['Position'] = cpt_working['Player'].map(maps_dict['Pos_map'])
|
542 |
if sim_sport_var1 == 'NFL':
|
543 |
-
cpt_working['Salary'] = cpt_working['Player'].map(maps_dict['Salary_map']) * 1.5
|
544 |
-
elif sim_sport_var1 == 'NBA':
|
545 |
cpt_working['Salary'] = cpt_working['Player'].map(maps_dict['Salary_map'])
|
|
|
|
|
546 |
cpt_working['Proj Own'] = cpt_working['Player'].map(maps_dict['cpt_Own_map']) / 100
|
547 |
cpt_working['Exposure'] = cpt_working['Freq']/(1000)
|
548 |
cpt_working['Edge'] = cpt_working['Exposure'] - cpt_working['Proj Own']
|
@@ -578,16 +578,6 @@ with tab1:
|
|
578 |
team_working['Freq'] = team_working['Freq'].astype(int)
|
579 |
team_working['Exposure'] = team_working['Freq']/(1000)
|
580 |
st.session_state.team_freq = team_working.copy()
|
581 |
-
|
582 |
-
if sim_site_var1 == 'Draftkings':
|
583 |
-
stack_working = pd.DataFrame(np.column_stack(np.unique(freq_copy.iloc[:,10:11].values, return_counts=True)),
|
584 |
-
columns=['Player','Freq']).sort_values('Freq', ascending=False).reset_index(drop=True)
|
585 |
-
elif sim_site_var1 == 'Fanduel':
|
586 |
-
stack_working = pd.DataFrame(np.column_stack(np.unique(freq_copy.iloc[:,9:10].values, return_counts=True)),
|
587 |
-
columns=['Player','Freq']).sort_values('Freq', ascending=False).reset_index(drop=True)
|
588 |
-
stack_working['Freq'] = stack_working['Freq'].astype(int)
|
589 |
-
stack_working['Exposure'] = stack_working['Freq']/(1000)
|
590 |
-
st.session_state.stack_freq = stack_working.copy()
|
591 |
|
592 |
with st.container():
|
593 |
if st.button("Reset Sim", key='reset_sim'):
|
|
|
540 |
cpt_working['Freq'] = cpt_working['Freq'].astype(int)
|
541 |
cpt_working['Position'] = cpt_working['Player'].map(maps_dict['Pos_map'])
|
542 |
if sim_sport_var1 == 'NFL':
|
|
|
|
|
543 |
cpt_working['Salary'] = cpt_working['Player'].map(maps_dict['Salary_map'])
|
544 |
+
elif sim_sport_var1 == 'NBA':
|
545 |
+
cpt_working['Salary'] = cpt_working['Player'].map(maps_dict['Salary_map']) * 1.5
|
546 |
cpt_working['Proj Own'] = cpt_working['Player'].map(maps_dict['cpt_Own_map']) / 100
|
547 |
cpt_working['Exposure'] = cpt_working['Freq']/(1000)
|
548 |
cpt_working['Edge'] = cpt_working['Exposure'] - cpt_working['Proj Own']
|
|
|
578 |
team_working['Freq'] = team_working['Freq'].astype(int)
|
579 |
team_working['Exposure'] = team_working['Freq']/(1000)
|
580 |
st.session_state.team_freq = team_working.copy()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
581 |
|
582 |
with st.container():
|
583 |
if st.button("Reset Sim", key='reset_sim'):
|