Commit 3566b0cb authored by 赵杰's avatar 赵杰

分组数据结果配置成json

parent 8853b6d0
...@@ -94,21 +94,21 @@ class UserCustomerDataAdaptor: ...@@ -94,21 +94,21 @@ class UserCustomerDataAdaptor:
cur_fund_nav_df = pd.DataFrame(list(data), columns=['price_date', 'nav', 'cnav']) cur_fund_nav_df = pd.DataFrame(list(data), columns=['price_date', 'nav', 'cnav'])
# # 对应基金分红 # # 对应基金分红
# sql = """select distinct `distribute_date`, `distribution` from `fund_distribution` where `fund_id`='{}' and `distribute_type`='1' order by `distribute_date` ASC""".format( sql = """select distinct `distribute_date`, `distribution` from `fund_distribution` where `fund_id`='{}' and `distribute_type`='1' order by `distribute_date` ASC""".format(
# cur_fund_id) cur_fund_id)
# cur = tamp_product_session.execute(sql) cur = tamp_product_session.execute(sql)
# data = cur.fetchall() data = cur.fetchall()
# cur_fund_distribution_df = pd.DataFrame(list(data), columns=['price_date', 'distribution']) cur_fund_distribution_df = pd.DataFrame(list(data), columns=['price_date', 'distribution'])
# self.all_fund_distribution[cur_fund_id] = cur_fund_distribution_df self.all_fund_distribution[cur_fund_id] = cur_fund_distribution_df
#
# # 对应基金performance数据 # 对应基金performance数据
# sql = """select distinct `price_date`, `ret_cum_1w`, `ret__cum_1m`, `ret_cum_6m`, `ret_cum_1y`, `ret_cum_ytd`, `ret_cum_incep` from `fund_performance` where `fund_id`='{}' order by `price_date` ASC""".format( sql = """select distinct `price_date`, `ret_1w`, `ret_cum_1m`, `ret_cum_6m`, `ret_cum_1y`, `ret_cum_ytd`, `ret_cum_incep` from `fund_performance` where `fund_id`='{}' order by `price_date` ASC""".format(
# cur_fund_id) cur_fund_id)
# cur = tamp_product_session.execute(sql) cur = tamp_product_session.execute(sql)
# data = cur.fetchall() data = cur.fetchall()
# cur_fund_performance_df = pd.DataFrame(list(data), cur_fund_performance_df = pd.DataFrame(list(data),
# columns=['price_date', 'ret_cum_1w', 'ret__cum_1m', 'ret_cum_6m', 'ret_cum_1y', 'ret_cum_ytd', 'ret_cum_incep']) columns=['price_date', 'ret_1w', 'ret_cum_1m', 'ret_cum_6m', 'ret_cum_1y', 'ret_cum_ytd', 'ret_cum_incep'])
# self.all_fund_performance[cur_fund_id] = cur_fund_performance_df self.all_fund_performance[cur_fund_id] = cur_fund_performance_df
cur_fund_nav_df["price_date"] = pd.to_datetime(cur_fund_nav_df["price_date"]) cur_fund_nav_df["price_date"] = pd.to_datetime(cur_fund_nav_df["price_date"])
cur_fund_nav_df.set_index("price_date", inplace=True) cur_fund_nav_df.set_index("price_date", inplace=True)
......
This diff is collapsed.
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