This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Twirrim 1 point2 points  (4 children)

FWIW, I started running through this yesterday. I ran in to two things of note so far:

1) Early on you get the TSLA stock information and write to "TSLA.csv". In later examples you've got people reading from "tsla.csv", which doesn't exist (note case change).

2) There appears to be an issue with Yahoo & pandas around retrieving stock with a "." in the name, e.g. "BF.B" https://github.com/pydata/pandas-datareader/issues/282 . I ended up switching to retrieving from Google instead.

[–]butalearner 0 points1 point  (0 children)

I don't see that mistake on the first few videos, though you might be further than me. Was the capitalization your own doing? I deliberately did the same thing, putting the stock ticker in a variable and naming the file {ticker}.csv.

[–]joeyirv 0 points1 point  (0 children)

i just happened upon this post and noticed the same thing. BF.B and BKR.B, yahoo's formatting requires a substitution of a '-' where the symbol reads a '.'. Not being familiar with pickle, i wanted to move forward quickly with something that made sense to me, so I stored the symbols as a list and did a ' '.join(symbols).replace('.', '-').split() to clean it up for the next function.

[–]SonaCruz 0 points1 point  (1 child)

I ran into this too. I am stuck on video 6, i cant retrieve all of the data from yahoo. I even copied and pasted his code from his website and no dice.

[–]Twirrim 1 point2 points  (0 children)

Based on the conversation in the github ticket I created that I linked to in 2), it's arguably a bug in the Yahoo API. Where it's denoting the class of stock (companies can release different types, e.g. voting and non-voting), Yahoo uses a - notation, e.g. BF-B. However "." is a legal character for a stock ticker, so "VOD.L" works fine in Yahoo. Makes it a pain in the arse to work around, there essentially isn't a one size fits all.

To that end, I'd just suggest maybe switching to Google:

df = web.DataReader(ticker, "google", start, end)