Getting all company pricing data in the S&P 500 - Python Programming for Finance p.6
Why Stack Overflow recommends it
Stack Overflow users link it as the source of code they are following or debugging, and answerers point to the relevant timestamp to explain how the download loop works.
Recommended by 1 people across 1 different months, 2017 to 2021.
What it is
Part 6 of sentdex's Python for Finance tutorial series, where he writes a script that loops over the S&P 500 ticker list from the previous part and downloads each company's price history with pandas-datareader, saving one CSV per ticker. The video is a screencast walkthrough of the code by the channel's author.
What people said
Recommends user8055438 · 2017-08 · Stack Overflow · on “S&P 500 List python script crashes”
@ands so to explain this we must go to the line before that. The if not os.path.exists('stock_dfs/{}.csv'.format(ticker)): is checking to see if a file exists. If it doesn't the df is a variable that reads using the data reader whatever the start, end and the location of the data. More on this here: [this video] skip to 6:20 and it should explain
Cites pathfineder · 2017-04 · Stack Overflow · on “can't bring the yahoo finance data”
I runing this code ( [this video] ) it keep saying error message --> Traceback (most recent call last): File "/Users/jason/PycharmProjects/yahoofinance/ATPQ6.py", line 50, in <module> get_data_from_yahoo() File "/Users/jason/PycharmProjects/yahoofinance/ATPQ6.py", line 44, in get_data_from_yahoo df = web.DataReader(ticker, "yahoo", start, end) File "/Users/jason/anaconda/lib/python3.6/site-packages/pandas_datareader/data.py", line 116, in DataReader session=session).read() File "/Users/jason/anaconda/lib/python3.6/site-packages/pandas_datareader/yahoo/daily.py", line 76, in read df = super(YahooDailyReader, self).read() File "/Users/jason/anaconda/lib/python3.6/site-packages/pandas_datareader/bas
Cites jinna · 2021-01 · Stack Overflow · on “python - finance - EOF Error - ran out of input”
I'm just writing code from this video [this video] in YouTube and I'm stumped on this error: Traceback (most recent call last): File "C:/Users/john/pycharm_coding/stock_investing_using_AI/stock investing/do now/scripts/finance.py", line 49, in <module> get_data_from_yahoo() File "C:/Users/john/pycharm_coding/stock_investing_using_AI/stock investing/do now/scripts/finance.py", line 31, in get_data_from_yahoo tickers = pickle.load(f) EOFError: Ran out of input I checked the code and everything is the same(unless you count the variable names), so I'm really puzzled. Here is my code: import bs4 as bs import datetime as dt import os import pandas as pd import pandas_datareader.data as web import pickl