File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed
Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -727,16 +727,20 @@ def _add_zero_weights_to_instrument_weights_df(
727727 instrument_list_to_add = (
728728 self .allocate_zero_instrument_weights_to_these_instruments ()
729729 )
730- weight_index = instrument_weights .index
731- new_pd_as_dict = dict (
732- [
733- (instrument_code , pd .Series ([0.0 ] * len (weight_index )))
734- for instrument_code in instrument_list_to_add
735- ]
736- )
737- new_pd = pd .DataFrame (new_pd_as_dict )
738-
739- padded_instrument_weights = pd .concat ([instrument_weights , new_pd ], axis = 1 )
730+ # weight_index = instrument_weights.index
731+ # new_pd_as_dict = dict(
732+ # [
733+ # (instrument_code, pd.Series([0.0] * len(weight_index)))
734+ # for instrument_code in instrument_list_to_add
735+ # ]
736+ # )
737+ # new_pd = pd.DataFrame(new_pd_as_dict)
738+ #
739+ # padded_instrument_weights = pd.concat([instrument_weights, new_pd], axis=1)
740+
741+ padded_instrument_weights = copy (instrument_weights )
742+ for zero_instr in instrument_list_to_add :
743+ padded_instrument_weights [zero_instr ] = 0.0
740744
741745 return padded_instrument_weights
742746
You can’t perform that action at this time.
0 commit comments