James McCool
commited on
Commit
·
4edaf5f
1
Parent(s):
b6825dd
Refactor reassess_lineup_edge function in reassess_edge.py to simplify the application of lineup edge calculations, enhancing code clarity and maintainability.
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.apply(lambda row: 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 |
|
|
|
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.apply(lambda row: 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 |
|