Created
September 17, 2012 09:19
-
-
Save fnielsen/3736395 to your computer and use it in GitHub Desktop.
Dates and matplotlib example with stock quotes from Novo Nordisk (NVO)
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
from matplotlib.finance import quotes_historical_yahoo | |
from matplotlib.dates import num2date | |
from matplotlib.pyplot import * | |
from datetime import date | |
quotes = quotes_historical_yahoo('NVO', date(2011, 1, 1), date.today()) | |
dates = [ num2date(row[0]) for row in quotes ] | |
closeprice = [ row[1] for row in quotes ] | |
plot(dates, closeprice) | |
show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment