For issues dealing with the Yahoo! Finance market data downloader. yfinance aims to solve this problem by offering a reliable, threaded, and Pythonic way to download historical market data from Yahoo! finance.
Documentation
How to install
# With Conda at the Anaconda prompt
conda install -c ranaroussi yfinance
# With pip
pip install yfinance --upgrade --no-cache-dir
Answers
- How to deal with multi-level column names downloaded with yfinance
yfinance
returns apandas.DataFrame
with multi-level column names, where there is a level for the ticker names and a level for the ticker prices.- This answer deals with the following issue:
- How to correctly read the the multi-level columns after saving the dataframe to a csv with
pandas.DataFrame.to_csv
- How to download single or multiple tickers into a single dataframe with single level column names and a ticker column
- How to correctly read the the multi-level columns after saving the dataframe to a csv with
- Pandas column multi-index to rows
- Shows how to download multiple ticker symbols and flatten the multi-level column names into single level columns with the ticker as one column.