James McCool commited on
Commit
47d93c4
·
1 Parent(s): b3ed56e

Limit concatenation in distribute_preset function to the top 5 entries of the working portfolio to further enhance performance and focus on the most relevant data.

Browse files
Files changed (1) hide show
  1. global_func/distribute_preset.py +1 -1
global_func/distribute_preset.py CHANGED
@@ -27,7 +27,7 @@ def distribute_preset(portfolio: pd.DataFrame, lineup_target: int, exclude_cols:
27
  curr_own_type_max = working_portfolio.loc[i, 'Weighted Own'] + (slack_var / 20 * working_portfolio.loc[i, 'Weighted Own'])
28
 
29
  working_portfolio = working_portfolio.drop(rows_to_drop).reset_index(drop=True)
30
- concat_portfolio = pd.concat([concat_portfolio, working_portfolio.head(10)])
31
 
32
  if len(concat_portfolio) >= lineup_target:
33
  return concat_portfolio.sort_values(by='Finish_percentile', ascending=True).head(lineup_target)
 
27
  curr_own_type_max = working_portfolio.loc[i, 'Weighted Own'] + (slack_var / 20 * working_portfolio.loc[i, 'Weighted Own'])
28
 
29
  working_portfolio = working_portfolio.drop(rows_to_drop).reset_index(drop=True)
30
+ concat_portfolio = pd.concat([concat_portfolio, working_portfolio.head(5)])
31
 
32
  if len(concat_portfolio) >= lineup_target:
33
  return concat_portfolio.sort_values(by='Finish_percentile', ascending=True).head(lineup_target)