Downloading multiple stocks at once from Yahoo Finance

Updated as of 2021-01-19 At this time, the implementation in the OP works without issue, to download multiple stocks. Version: 0.9.0 Date: July 10, 2020 GitHub: pydata / pandas-datareader tickers = [‘msft’, ‘aapl’, ‘intc’, ‘tsm’, ‘goog’, ‘amzn’, ‘fb’, ‘nvda’] df = pdr.DataReader(tickers, data_source=”yahoo”, start=”2017-01-01″, end=’2020-09-28′) Original Answer If you read through Pandas DataReader’s documentation, they … Read more

How to show a pandas dataframe into a existing flask html table?

working example: python code: from flask import Flask, request, render_template, session, redirect import numpy as np import pandas as pd app = Flask(__name__) df = pd.DataFrame({‘A’: [0, 1, 2, 3, 4], ‘B’: [5, 6, 7, 8, 9], ‘C’: [‘a’, ‘b’, ‘c–‘, ‘d’, ‘e’]}) @app.route(“https://stackoverflow.com/”, methods=(“POST”, “GET”)) def html_table(): return render_template(‘simple.html’, tables=[df.to_html(classes=”data”)], titles=df.columns.values) if __name__ == … Read more

“TypeError: string indices must be integers” when getting data of a stock from Yahoo Finance using Pandas Datareader

None of the solutions reported here so far worked for me. As per the discussion here Yahoo made changes to their API that broke compatibility with previous pandas datareader versions. In the same Github thread a fix is reported, implemented in a pull request from Github user raphi6. I confirmed the pull request works fine. … Read more

import pandas_datareader gives ImportError: cannot import name ‘is_list_like’

A solution without changing any files locally and bypass the version control of your package manager (pip) is to define is_list_like like this: import pandas as pd pd.core.common.is_list_like = pd.api.types.is_list_like right before import pandas_datareader as web Furthermore this problem will be fixed in pandas_datareader version 0.7.0 release.