Commit 629ec9aa authored by 赵杰's avatar 赵杰

fix bug

parent 5e5724c1
......@@ -755,6 +755,8 @@ class PortfolioDiagnose(object):
self.new_correlation = self.new_correlation.fillna(1).round(2)
self.new_correlation.columns = self.new_correlation.columns.map(lambda x: get_fund_name(x).values[0][0])
self.new_correlation.index = self.new_correlation.index.map(lambda x: get_fund_name(x).values[0][0])
self.proposal_fund = list(set(list(max_sharp_weights.keys())) - (set(list(max_sharp_weights.keys())) & set(
list(self.portfolio_dict.keys()))))
end4 = time.time()
print("模型计算一次时间:", end4 - start)
......@@ -996,8 +998,9 @@ class PortfolioDiagnose(object):
# 建议基金数据
index_return, propose_fund_return = self.return_compare()
propose_fund_id_list = list(propose_fund_return.columns)
propose_fund_id_list.remove("return")
# propose_fund_id_list = list(propose_fund_return.columns)
propose_fund_id_list = list(self.proposal_fund)
# propose_fund_id_list.remove("return")
with TAMP_SQL(tamp_product_engine) as tamp_product:
tamp_product_session = tamp_product.session
sql_product = "select distinct `id`, `fund_short_name`, `nav_frequency`, `substrategy` from `fund_info`"
......
......@@ -198,7 +198,7 @@ class DataIntegrate:
# res = executor.map(gen_radar_chart, propose_radar_chart_data)
res = []
for fund_id in portfolio_diagnose.propose_portfolio.columns:
r = fund_index_compare(fund_id)
r = fund_index_compare(fund_id, portfolio_diagnose.portfolio_dict.get(fund_id, 2))
res.append(r)
for i in range(len(propose_fund_evaluation)):
propose_fund_data_list.append({
......
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