Search code examples
pythonpandasdatareader

Pandas Python UnicodeDecodeError


I'm just practicing writing codes for data extraction. I used the following code and it worked before. However, I've recently updated pandas and now it doesn't work and gives me an error.

import pandas as pd
from pandas_datareader import data
data.DataReader(name = ["MSFT", "GOOG", "AAPL", "YHOO", "AMZN"], data_source = "google",
               start = "2010-01-01", end = "2016-12-31")`

Resulting in the following error:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa0 in position 46626: invalid start byte'

I've tried looking online here and used the .encode('utf-8).strip() at the end of each parameters to see if it works but it's not.


Solution

  • This is a known issue which is not yet fixed.

    https://github.com/pydata/pandas-datareader/issues/424