--Thank you
Lucas
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
On Mon, Oct 14, 2013 at 6:12 AM, Lukasz Szybalski <szyb...@gmail.com> wrote:
Hello,I'm trying to figure out how to get price earnings and market cap for "MSFT" stock.
I see the function get_quote_yahoo in the source, and I see mentioning of symbol and
# for codes see: http://www.gummy-stuff.org/Yahoo-data.htmrequest = ''.join(compat.itervalues(_yahoo_codes)) # code request stringheader = list(_yahoo_codes.keys())
https://github.com/pydata/pandas/blob/7261d436aab5e32e20cb5e91891304b124cc32ed/pandas/io/data.py
How do I go from :
msft = DataReader("MSFT", "yahoo", datetime(2009,1,1))to getting the PE and market cap?I'm not sure, but it doesn't look this is is explicitly available the way this is written. Correct me if I'm wrong. Presumably, you can just adjust the URL by hand to your needs though and load it into a DataFrame.I don't know about getting historical data, but to get an idea, since the _yahoo_codes dictionary is mutable, you can do something like this. I don't know why market cap doesn't work.from pandas.io.data import get_quote_yahoo, _yahoo_codesget_quote_yahoo("MSFT")_yahoo_codes.update({'MarketCap' : 'j1'})
get_quote_yahoo("MSFT")
287.0B and I guess for some reason it doesn't get parsed, probably because of the B? get_quote_yahoo("MSFT") 52WeekLow DividentYeld MarketCap MSFT 26.26 2.7 NaN |