James McCool
commited on
Commit
·
f9b3b85
1
Parent(s):
860cdc8
Refactor reassess_lineup_edge function in global_func/reassess_edge.py to simplify the calculation of 'Lineup Edge' by removing unnecessary lambda application, improving code readability and performance.
Browse files
global_func/reassess_edge.py
CHANGED
|
@@ -61,7 +61,7 @@ def reassess_dupes(row: pd.Series, salary_max: int) -> float:
|
|
| 61 |
|
| 62 |
def reassess_lineup_edge(row: pd.Series, Contest_Size: int) -> float:
|
| 63 |
row['Lineup Edge'] = row['Win%'] * ((.5 - row['Finish_percentile']) * (Contest_Size / 2.5))
|
| 64 |
-
row['Lineup Edge'] = row
|
| 65 |
|
| 66 |
return row['Lineup Edge'] - row['Lineup Edge'].mean()
|
| 67 |
|
|
|
|
| 61 |
|
| 62 |
def reassess_lineup_edge(row: pd.Series, Contest_Size: int) -> float:
|
| 63 |
row['Lineup Edge'] = row['Win%'] * ((.5 - row['Finish_percentile']) * (Contest_Size / 2.5))
|
| 64 |
+
row['Lineup Edge'] = row['Lineup Edge'] / (row['Dupes'] + 1) if row['Dupes'] > 0 else row['Lineup Edge']
|
| 65 |
|
| 66 |
return row['Lineup Edge'] - row['Lineup Edge'].mean()
|
| 67 |
|