Skip to content

Commit

Permalink
上傳簡介的投影片跟一些範例
Browse files Browse the repository at this point in the history
  • Loading branch information
victorgau committed Mar 10, 2017
1 parent eb549b9 commit 19a6bac
Show file tree
Hide file tree
Showing 11 changed files with 1,542 additions and 0 deletions.
Binary file not shown.
59 changes: 59 additions & 0 deletions Notebooks/Get NASDAQ Company List.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import pandas as pd"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"url = \"http://www.nasdaq.com/screening/companies-by-industry.aspx?exchange=NASDAQ&render=download\"\n",
"data = pd.read_csv(url)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"data.head()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python [default]",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.2"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
54 changes: 54 additions & 0 deletions Notebooks/亂數股價圖 (numpy).ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%matplotlib inline\n",
"# https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.normal.html\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"\n",
"duration = 100\n",
"mu, sigma = 0.0, 1.0\n",
"\n",
"x = range(duration)\n",
"\n",
"s = np.random.normal(mu, sigma, duration)\n",
"y = s.cumsum()\n",
"\n",
"plt.plot(x, y)\n",
"plt.xlabel(\"Time\")\n",
"plt.ylabel(\"Value\")\n",
"plt.savefig(\"RandomGraph.png\")\n",
"plt.show()"
]
}
],
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python [default]",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.2"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
69 changes: 69 additions & 0 deletions Notebooks/亂數股價圖.ipynb

Large diffs are not rendered by default.

63 changes: 63 additions & 0 deletions Notebooks/使用 quandl 抓資料.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import quandl\n",
"data = quandl.get(\"WIKI/TSLA\")\n",
"type(data)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# 顯示最後幾筆資料\n",
"data.tail()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# 重新排序後顯示前面幾筆資料\n",
"data.sort_index(ascending=False).head()"
]
}
],
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python [default]",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.2"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
Loading

0 comments on commit 19a6bac

Please sign in to comment.