James McCool
commited on
Commit
·
cd18aa9
1
Parent(s):
82d3e88
Update small_field_preset function to reset index after filtering working portfolio by Finish_percentile, ensuring consistent DataFrame structure for subsequent calculations.
Browse files
global_func/small_field_preset.py
CHANGED
|
@@ -5,7 +5,7 @@ def small_field_preset(portfolio: pd.DataFrame, lineup_target: int):
|
|
| 5 |
for slack_var in range(1, 10):
|
| 6 |
rows_to_drop = []
|
| 7 |
working_portfolio = portfolio.sort_values(by='Own', ascending = False).reset_index(drop=True)
|
| 8 |
-
working_portfolio = working_portfolio[working_portfolio['Finish_percentile'] <= .10]
|
| 9 |
curr_own_type_max = working_portfolio.loc[0, 'Weighted Own'] + (slack_var / 10 * working_portfolio.loc[0, 'Weighted Own'])
|
| 10 |
|
| 11 |
for i in range(1, len(working_portfolio)):
|
|
|
|
| 5 |
for slack_var in range(1, 10):
|
| 6 |
rows_to_drop = []
|
| 7 |
working_portfolio = portfolio.sort_values(by='Own', ascending = False).reset_index(drop=True)
|
| 8 |
+
working_portfolio = working_portfolio[working_portfolio['Finish_percentile'] <= .10].reset_index(drop=True)
|
| 9 |
curr_own_type_max = working_portfolio.loc[0, 'Weighted Own'] + (slack_var / 10 * working_portfolio.loc[0, 'Weighted Own'])
|
| 10 |
|
| 11 |
for i in range(1, len(working_portfolio)):
|