diff --git a/app/service/result_service.py b/app/service/result_service.py index c5b97749e24be29145d778a1d31966cd2fcebc25..878c75ce42f2328fffb714d43fc0c3fdb2b95529 100644 --- a/app/service/result_service.py +++ b/app/service/result_service.py @@ -379,16 +379,20 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor): return str(a) + "/" + str(b) profit_df_cp = signal_fund_cum_weight.copy() - profit_df_cp["date"] = profit_df_cp.index + profit_df_cp["date"] = list(profit_df_cp.index) grouped = profit_df_cp.groupby(profit_df_cp["date"].apply(year_month)) - month_signal_fund_cum = grouped.last().sort_values(by="date") - del month_signal_fund_cum["date"] + month_signal_fund_cum = grouped.last() + month_signal_fund_cum.rename(columns={"date": "datetime"}, inplace=True) + month_signal_fund_cum.sort_values(by="datetime", inplace=True) + del month_signal_fund_cum["datetime"] p_cum_df = cum_return_ratio_df.copy() - p_cum_df["date"] = p_cum_df.index + p_cum_df["date"] = list(p_cum_df.index) cum_grouped = p_cum_df.groupby(p_cum_df["date"].apply(year_month)) - month_fund_cum = cum_grouped.last().sort_values(by="date") - del month_fund_cum["date"] + month_fund_cum = cum_grouped.last() + month_fund_cum.rename(columns={"date": "datetime"}, inplace=True) + month_fund_cum.sort_values(by="datetime", inplace=True) + del month_fund_cum["datetime"] return cum_return_ratio_df, month_fund_cum, month_signal_fund_cum