Spaces:
Sleeping
Sleeping
James McCool
commited on
Commit
·
5fe0967
1
Parent(s):
0608368
Refactor salary mapping in app.py to consistently apply salary calculations to the 'flex_working' DataFrame for both NFL and NBA players across DraftKings and FanDuel. This change enhances the accuracy of player salary projections by ensuring the correct mapping logic is applied uniformly, improving overall clarity in the salary calculation process.
Browse files
app.py
CHANGED
@@ -561,11 +561,11 @@ with tab1:
|
|
561 |
flex_working['Position'] = flex_working['Player'].map(maps_dict['Pos_map'])
|
562 |
if sim_site_var1 == 'Draftkings':
|
563 |
if sim_sport_var1 == 'NFL':
|
564 |
-
|
565 |
elif sim_sport_var1 == 'NBA':
|
566 |
-
|
567 |
elif sim_site_var1 == 'Fanduel':
|
568 |
-
|
569 |
flex_working['Proj Own'] = (flex_working['Player'].map(maps_dict['Own_map']) / 100) - (flex_working['Player'].map(maps_dict['cpt_Own_map']) / 100)
|
570 |
flex_working['Exposure'] = flex_working['Freq']/(1000)
|
571 |
flex_working['Edge'] = flex_working['Exposure'] - flex_working['Proj Own']
|
|
|
561 |
flex_working['Position'] = flex_working['Player'].map(maps_dict['Pos_map'])
|
562 |
if sim_site_var1 == 'Draftkings':
|
563 |
if sim_sport_var1 == 'NFL':
|
564 |
+
flex_working['Salary'] = flex_working['Player'].map(maps_dict['Salary_map']) / 1.5
|
565 |
elif sim_sport_var1 == 'NBA':
|
566 |
+
flex_working['Salary'] = flex_working['Player'].map(maps_dict['Salary_map'])
|
567 |
elif sim_site_var1 == 'Fanduel':
|
568 |
+
flex_working['Salary'] = flex_working['Player'].map(maps_dict['Salary_map'])
|
569 |
flex_working['Proj Own'] = (flex_working['Player'].map(maps_dict['Own_map']) / 100) - (flex_working['Player'].map(maps_dict['cpt_Own_map']) / 100)
|
570 |
flex_working['Exposure'] = flex_working['Freq']/(1000)
|
571 |
flex_working['Edge'] = flex_working['Exposure'] - flex_working['Proj Own']
|