[Tutor] Does matplotlib.finance still work?

Alan Gauld alan.gauld at yahoo.co.uk
Fri Aug 25 13:01:33 EDT 2017


On 25/08/17 15:19, C W wrote:
> I did not mean to leave out the error message, it was very long.

That just means it has a lot of information in it :-)

>  I think the package has been removed.

I don;t think so based on the traceback...

>>>> quotes = quotes_historical_yahoo_ochl('APX', start, ... )
> ------------------------------
> TypeError: quotes_historical_yahoo_ochl() missing 1 required positional
> argument: 'date2'

Did you check what parameters were required for this function?
The error says you are missing one.

> /Users/anaconda/lib/python3.6/site-packages/matplotlib/finance.py in

Note the filename. That suggests finance.py is still there.

> quotes_historical_yahoo_ochl(ticker, date1, date2, asobject, adjusted,
> cachename) 411 return _quotes_historical_yahoo(ticker, date1, date2,
> asobject=asobject, 412 adjusted=adjusted, cachename=cachename, --> 413
> ochl=True) 414 415
> /Users/anaconda/lib/python3.6/site-packages/matplotlib/finance.py in
> _quotes_historical_yahoo(ticker, date1, date2, asobject, adjusted,
> cachename, ochl) 501 # warnings.warn("Recommend changing to asobject=None")
> 502 --> 503 fh = fetch_historical_yahoo(ticker, date1, date2, cachename) 504
> 505 try:

Some warnings there that might be relevant, I don't know
anything about the package or function.

You could try running the help() function:

>>> help(quotes_historical_yahoo_ochl)

And see if it shows anything useful.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list