James McCool
commited on
Commit
·
4ed60b8
1
Parent(s):
433242b
Add debug print statements in hedging_preset.py to output player and lineup data during processing. Adjusted lineup target calculations to use list size directly, enhancing clarity in the lineup generation logic.
Browse files
global_func/hedging_preset.py
CHANGED
|
@@ -15,6 +15,7 @@ def hedging_preset(portfolio: pd.DataFrame, lineup_target: int, projections_file
|
|
| 15 |
concat_portfolio = pd.DataFrame(columns=portfolio.columns)
|
| 16 |
|
| 17 |
for players in top_owned:
|
|
|
|
| 18 |
working_df = portfolio.copy()
|
| 19 |
|
| 20 |
# Create mask for lineups that contain any of the removed players
|
|
@@ -28,10 +29,12 @@ def hedging_preset(portfolio: pd.DataFrame, lineup_target: int, projections_file
|
|
| 28 |
)
|
| 29 |
|
| 30 |
removed_df = working_df[remove_mask]
|
|
|
|
| 31 |
locked_df = working_df[lock_mask]
|
|
|
|
| 32 |
|
| 33 |
-
removed_lineups = small_field_preset(removed_df, math.ceil(lineup_target /
|
| 34 |
-
locked_lineups = large_field_preset(locked_df, math.ceil(lineup_target /
|
| 35 |
|
| 36 |
concat_portfolio = pd.concat([concat_portfolio, removed_lineups, locked_lineups])
|
| 37 |
|
|
|
|
| 15 |
concat_portfolio = pd.DataFrame(columns=portfolio.columns)
|
| 16 |
|
| 17 |
for players in top_owned:
|
| 18 |
+
print(players)
|
| 19 |
working_df = portfolio.copy()
|
| 20 |
|
| 21 |
# Create mask for lineups that contain any of the removed players
|
|
|
|
| 29 |
)
|
| 30 |
|
| 31 |
removed_df = working_df[remove_mask]
|
| 32 |
+
print(removed_df.head(10))
|
| 33 |
locked_df = working_df[lock_mask]
|
| 34 |
+
print(locked_df.head(10))
|
| 35 |
|
| 36 |
+
removed_lineups = small_field_preset(removed_df, math.ceil(lineup_target / list_size), excluded_cols)
|
| 37 |
+
locked_lineups = large_field_preset(locked_df, math.ceil(lineup_target / list_size), excluded_cols)
|
| 38 |
|
| 39 |
concat_portfolio = pd.concat([concat_portfolio, removed_lineups, locked_lineups])
|
| 40 |
|