Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
alpha-mind
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dr.李
alpha-mind
Commits
04962c48
Commit
04962c48
authored
Oct 31, 2020
by
Dr.李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FEATURE: switch map industry name
parent
92502036
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
13 deletions
+27
-13
utilities.py
alphamind/data/engines/utilities.py
+27
-13
No files found.
alphamind/data/engines/utilities.py
View file @
04962c48
...
...
@@ -5,6 +5,7 @@ Created on 2017-12-25
@author: cheng.li
"""
import
os
from
typing
import
Dict
from
typing
import
Iterable
...
...
@@ -51,7 +52,20 @@ def _map_factors(factors: Iterable[str], used_factor_tables) -> Dict:
return
factor_cols
def
_map_industry_category
(
category
:
str
)
->
str
:
if
"DB_VENDOR"
in
os
.
environ
and
os
.
environ
[
"DB_VENDOR"
]
.
lower
()
==
"rl"
:
def
_map_industry_category
(
category
:
str
)
->
str
:
if
category
==
'sw'
:
return
'申万行业分类(2014)'
elif
category
==
'zz'
:
return
'中证行业分类'
elif
category
==
'zx'
:
return
'中信标普行业分类'
elif
category
==
'zjh'
:
return
'证监会行业分类(2012)-证监会'
else
:
raise
ValueError
(
"No other industry is supported at the current time"
)
else
:
def
_map_industry_category
(
category
:
str
)
->
str
:
if
category
==
'sw'
:
return
'申万行业分类'
elif
category
==
'sw_adj'
:
...
...
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