Commit fccb2110 authored by 赵杰's avatar 赵杰

宗熹新算法推荐

parent c485365b
...@@ -105,6 +105,7 @@ class UserCustomerDataAdaptor: ...@@ -105,6 +105,7 @@ class UserCustomerDataAdaptor:
product_df = product_df.drop_duplicates("fund_id") product_df = product_df.drop_duplicates("fund_id")
user_customer_order_df = order_df.set_index('fund_id').join(product_df.set_index('fund_id')).reset_index() user_customer_order_df = order_df.set_index('fund_id').join(product_df.set_index('fund_id')).reset_index()
user_customer_order_df["confirm_share_date"] = user_customer_order_df["confirm_share_date"].apply(lambda x: pd.to_datetime(x.date()))
self.start_date = user_customer_order_df["confirm_share_date"].min() self.start_date = user_customer_order_df["confirm_share_date"].min()
self.customer_real_name = user_customer_order_df["customer_name"].values[0] self.customer_real_name = user_customer_order_df["customer_name"].values[0]
self.ifa_real_name = user_customer_order_df["username"].values[0] self.ifa_real_name = user_customer_order_df["username"].values[0]
...@@ -162,6 +163,8 @@ class UserCustomerDataAdaptor: ...@@ -162,6 +163,8 @@ class UserCustomerDataAdaptor:
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_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'])
cur_fund_performance_df = cur_fund_performance_df[
cur_fund_performance_df["price_date"] <= self.end_date.date()]
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"])
......
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