Posts

Showing posts from October, 2021

Solve the problem of Google Colab's DataReader Error to get financial data for free

Image
If you use the code below to get the financial data from yahoo. The Google Colaboratory will incur an error, because the pandas_datareader is old version in Colaboratory. from pandas_datareader import data import pandas as pd import matplotlib.pyplot as plt import datetime as dt import numpy as np start = dt.date(2010,1,1) end = dt.date(2020,12,31) aapl = data.DataReader('GOOGL',"yahoo",start,end) aapl.head() To use the code below to upgrade the pandas_datareader. !pip install --upgrade pandas-datareader from pandas_datareader import data import pandas as pd import matplotlib.pyplot as plt import datetime as dt import numpy as np start = dt.date(2010,1,1) end = dt.date(2020,12,31) aapl = data.DataReader('GOOGL',"yahoo",start,end) aapl.head() and the library will be upgraded and you can get the newest data.