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
6545cbcf
Commit
6545cbcf
authored
Dec 04, 2020
by
pengxiong@wealthgrow.cn
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
90a538eb
d488e753
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
38 deletions
+43
-38
portfolio_diagnose.py
app/service/portfolio_diagnose.py
+42
-33
fund_rank.py
app/utils/fund_rank.py
+1
-5
No files found.
app/service/portfolio_diagnose.py
View file @
6545cbcf
This diff is collapsed.
Click to expand it.
app/utils/fund_rank.py
View file @
6545cbcf
from
sqlalchemy
import
create_engine
# db = create_engine(
# 'mysql+pymysql://tamp_fund:@imeng408@tamper.mysql.polardb.rds.aliyuncs.com:3306/tamp_fund?charset=utf8mb4',
# pool_size=50,
...
...
@@ -43,7 +39,7 @@ def get_nav(fund, start_date, rollback=False, invest_type='public'):
"WHERE ts_code='{}'"
.
format
(
fund
)
cur
=
tamp_product_session
.
execute
(
sql
)
data
=
cur
.
fetchall
()
df
=
pd
.
DataFrame
(
list
(
data
),
columns
=
[
'
ts_code
'
,
'end_date'
,
'adj_nav'
])
.
dropna
(
how
=
'any'
)
df
=
pd
.
DataFrame
(
list
(
data
),
columns
=
[
'
fund_id
'
,
'end_date'
,
'adj_nav'
])
.
dropna
(
how
=
'any'
)
df
.
rename
({
'ts_code'
:
'fund_id'
},
axis
=
1
,
inplace
=
True
)
else
:
sql
=
"SELECT fund_id, price_date, cumulative_nav FROM fund_nav "
\
...
...
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