Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
F
fund_report
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
彭熊
fund_report
Commits
33df3fe6
Commit
33df3fe6
authored
Dec 02, 2020
by
赵杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复pandas升级后的代码问题
parent
c70a4add
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
result_service.py
app/service/result_service.py
+11
-7
No files found.
app/service/result_service.py
View file @
33df3fe6
...
...
@@ -143,7 +143,7 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor):
col
=
list
(
month_earn
.
columns
)
col_
=
{
x
:
x
.
replace
(
'_earn'
,
''
)
for
x
in
list
(
col
)}
month_earn
.
rename
(
columns
=
col_
,
inplace
=
True
)
folio_report_data
[
"contribution_decomposition"
]
=
month_earn
#
folio_report_data["contribution_decomposition"] = month_earn
# 组合内单个基金净值数据 组合内基金持仓数据
result_fund_nav_info
,
result_fund_hoding_info
=
self
.
group_fund_basic_info_data
(
cur_folio_order_data
,
cur_folio_result_cnav_data
,
cumulative_profit
,
total_cost
)
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment