Spaces:
Running
Running
James McCool
commited on
Commit
·
13b2733
1
Parent(s):
cbef4f6
Refactor Cut_Odds mapping in init_baselines function
Browse files- Update mapping of Cut_Odds to use set_index for improved performance
- Ensure accurate retrieval of odds associated with players
app.py
CHANGED
@@ -72,7 +72,7 @@ def init_baselines():
|
|
72 |
cursor = collection.find()
|
73 |
player_frame = pd.DataFrame(cursor)
|
74 |
|
75 |
-
player_frame['Cut_Odds'] = player_frame['Player'].map(placement_frame['Cut_Odds'])
|
76 |
player_frame = player_frame[['Player', 'Cut_Odds'] + [col for col in player_frame.columns if col not in ['Player', 'Cut_Odds']]]
|
77 |
|
78 |
timestamp = player_frame['Timestamp'][0]
|
|
|
72 |
cursor = collection.find()
|
73 |
player_frame = pd.DataFrame(cursor)
|
74 |
|
75 |
+
player_frame['Cut_Odds'] = player_frame['Player'].map(placement_frame.set_index('Player')['Cut_Odds'])
|
76 |
player_frame = player_frame[['Player', 'Cut_Odds'] + [col for col in player_frame.columns if col not in ['Player', 'Cut_Odds']]]
|
77 |
|
78 |
timestamp = player_frame['Timestamp'][0]
|