Last active
April 19, 2017 19:03
-
-
Save olp-cs/6745331 to your computer and use it in GitHub Desktop.
pandas demo: reading data from Yahoo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Last updated: 2017 | |
import pandas.io.data as web | |
# Read the stock price data from Yahoo | |
apple = web.DataReader('AAPL', 'yahoo', start = '01/01/2012', end = '25/10/2012') | |
# Display several lines | |
apple[0:5] | |
# Plot closing prices | |
apple['Close'].plot() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I copy this in canopy there appears the error message:
NameError Traceback (most recent call last)
C:\Users\Paul\AppData\Local\Enthought\Canopy32\App\appdata\canopy-1.3.0.1715.win-x86\lib\site-packages\IPython\utils\py3compat.pyc in execfile(fname, glob, loc)
C:\Users\Paul\AppData\Local\Enthought\Canopy32\App\appdata\canopy-1.3.0.1715.win-x86\Lib\site-packages\IPython\utils\py3compat.py in ()
3
4 # Read the stock price data from Yahoo
----> 5 apple = DataReader('AAPL', 'yahoo', start = '01/01/2012', end = '25/10/2012')
6
7 # Display several lines
NameError: name 'DataReader' is not defined