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
14de95aa
Commit
14de95aa
authored
Dec 10, 2020
by
赵杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
结果值0
parent
ec8277a9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
data_service.py
app/service/data_service.py
+1
-1
result_service_v2.py
app/service/result_service_v2.py
+4
-1
No files found.
app/service/data_service.py
View file @
14de95aa
...
@@ -84,7 +84,7 @@ class UserCustomerDataAdaptor:
...
@@ -84,7 +84,7 @@ class UserCustomerDataAdaptor:
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
()
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
]
user_customer_order_df
=
user_customer_order_df
[
user_customer_order_df
[
"confirm_share_date"
]
<
self
.
end_date
]
user_customer_order_df
=
user_customer_order_df
[
user_customer_order_df
[
"confirm_share_date"
]
<
=
self
.
end_date
]
user_customer_order_df
.
index
=
pd
.
Series
(
range
(
len
(
user_customer_order_df
)))
user_customer_order_df
.
index
=
pd
.
Series
(
range
(
len
(
user_customer_order_df
)))
return
user_customer_order_df
return
user_customer_order_df
...
...
app/service/result_service_v2.py
View file @
14de95aa
...
@@ -414,6 +414,9 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor):
...
@@ -414,6 +414,9 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor):
fund_profit_ratio
=
nav_net_amount_df
[
amount_name
+
"_profit_ratio"
]
.
dropna
()
+
1
fund_profit_ratio
=
nav_net_amount_df
[
amount_name
+
"_profit_ratio"
]
.
dropna
()
+
1
amount_ratio_shift
=
nav_net_amount_df
[
amount_name
+
"_amount_ratio"
]
.
shift
(
1
)
amount_ratio_shift
=
nav_net_amount_df
[
amount_name
+
"_amount_ratio"
]
.
shift
(
1
)
num_va
=
len
(
amount_ratio_shift
[
amount_ratio_shift
.
values
==
0
])
num_va
=
len
(
amount_ratio_shift
[
amount_ratio_shift
.
values
==
0
])
if
num_va
+
1
>
len
(
amount_ratio_shift
):
amount_ratio_shift
.
iloc
[
num_va
]
=
0
else
:
amount_ratio_shift
.
iloc
[
num_va
]
=
amount_ratio_shift
.
values
[
num_va
+
1
]
amount_ratio_shift
.
iloc
[
num_va
]
=
amount_ratio_shift
.
values
[
num_va
+
1
]
nav_net_amount_df
[
amount_name
+
"_profit_ratio_weight"
]
=
amount_ratio_shift
*
nav_net_amount_df
[
amount_name
+
"_profit_ratio"
]
nav_net_amount_df
[
amount_name
+
"_profit_ratio_weight"
]
=
amount_ratio_shift
*
nav_net_amount_df
[
amount_name
+
"_profit_ratio"
]
nav_net_amount_df
[
amount_name
+
"_profit_cum_ratio_weight"
]
=
(
fund_profit_ratio
.
cumprod
()
-
1
)
*
amount_ratio_shift
# enter_date = nav_net_amount_df[amount_name+"_profit_ratio"].dropna()
nav_net_amount_df
[
amount_name
+
"_profit_cum_ratio_weight"
]
=
(
fund_profit_ratio
.
cumprod
()
-
1
)
*
amount_ratio_shift
# enter_date = nav_net_amount_df[amount_name+"_profit_ratio"].dropna()
...
...
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