James McCool commited on
Commit
0808078
·
1 Parent(s): efe0fbf

Limit concatenation in distribute_preset function to the top 5 entries of the working portfolio to enhance performance and maintain 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
  concat_portfolio = concat_portfolio.drop_duplicates(subset=['median', 'salary', 'Own'])
32
 
33
  if len(concat_portfolio) >= 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
  concat_portfolio = concat_portfolio.drop_duplicates(subset=['median', 'salary', 'Own'])
32
 
33
  if len(concat_portfolio) >= lineup_target: