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
3321d3af
Commit
3321d3af
authored
May 02, 2017
by
Dr.李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update example
parent
01c9058f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
factor analysis.ipynb
notebooks/factor analysis.ipynb
+9
-7
No files found.
notebooks/factor analysis.ipynb
View file @
3321d3af
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
"benchmark = 'zz500'\n",
"benchmark = 'zz500'\n",
"factor = 'ROEAfterNonRecurring' # 'DROEAfterNonRecurring'\n",
"factor = 'ROEAfterNonRecurring' # 'DROEAfterNonRecurring'\n",
"\n",
"\n",
"conn = sqlalchemy.create_engine('mysql+
mysqldb://root:we083826@localhost
:3306/multifactor?charset=utf8')\n",
"conn = sqlalchemy.create_engine('mysql+
pymysql://sa:we083826@10.63.6.176
:3306/multifactor?charset=utf8')\n",
"df = pd.read_sql('select factor_data.{0}, trade_data.Return as dailyReturn, {1}.*, 1 as Market '\n",
"df = pd.read_sql('select factor_data.{0}, trade_data.Return as dailyReturn, {1}.*, 1 as Market '\n",
" 'from factor_data, trade_data, {1} '\n",
" 'from factor_data, trade_data, {1} '\n",
" 'where factor_data.Date = {1}.Date and factor_data.Code = {1}.Code '\n",
" 'where factor_data.Date = {1}.Date and factor_data.Code = {1}.Code '\n",
...
@@ -252,7 +252,7 @@
...
@@ -252,7 +252,7 @@
"metadata": {},
"metadata": {},
"outputs": [],
"outputs": [],
"source": [
"source": [
"total_data.pos.groupby(groups).apply(lambda x:
np.abs(x)
.sum()).head()"
"total_data.pos.groupby(groups).apply(lambda x:
x
.sum()).head()"
]
]
},
},
{
{
...
@@ -484,7 +484,9 @@
...
@@ -484,7 +484,9 @@
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": null,
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"outputs": [],
"source": [
"source": [
"import gc\n",
"import gc\n",
...
@@ -503,9 +505,9 @@
...
@@ -503,9 +505,9 @@
],
],
"metadata": {
"metadata": {
"kernelspec": {
"kernelspec": {
"display_name": "Python
[conda root]
",
"display_name": "Python
3
",
"language": "python",
"language": "python",
"name": "
conda-root-py
"
"name": "
python3
"
},
},
"language_info": {
"language_info": {
"codemirror_mode": {
"codemirror_mode": {
...
@@ -517,9 +519,9 @@
...
@@ -517,9 +519,9 @@
"name": "python",
"name": "python",
"nbconvert_exporter": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"pygments_lexer": "ipython3",
"version": "3.
5.3
"
"version": "3.
6.1
"
}
}
},
},
"nbformat": 4,
"nbformat": 4,
"nbformat_minor":
2
"nbformat_minor":
1
}
}
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