Commit 7048ef8d authored by Dr.李's avatar Dr.李

remove unnecessary dependency on industry

parent 729a28af
......@@ -25,6 +25,5 @@ class ExecutorBase(metaclass=abc.ABCMeta):
def calc_turn_over(target_pos: pd.DataFrame, current_pos: pd.DataFrame) -> float:
pos_merged = pd.merge(target_pos, current_pos, on=['code'], how='outer')
pos_merged.fillna(0, inplace=True)
pos_merged['industry'] = pos_merged['industry_x'].where(pos_merged['industry_x'] != 0, pos_merged['industry_y'])
turn_over = np.abs(pos_merged.weight_x - pos_merged.weight_y).sum()
return turn_over
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment