Last answered:

17 Nov 2023

Posted on:

28 Jul 2023

1

NotImplementedError

Hi, I'm getting this error when I try to execute the line before the last one (when we assing the data to the variable PG):


NotImplementedError                       Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_5556\1473850925.py in <module>
----> 1 PG = wb.DataReader('PG', data_source='Yahoo', start='1995-1-1')

~\anaconda3\lib\site-packages\pandas\util\_decorators.py in wrapper(*args, **kwargs)
    205                         f"Can only specify {repr(old_arg_name)} "
    206                         f"or {repr(new_arg_name)}, not both."
--> 207                     )
    208                     raise TypeError(msg)
    209                 kwargs[new_arg_name] = new_arg_value

~\anaconda3\lib\site-packages\pandas_datareader\data.py in DataReader(name, data_source, start, end, retry_count, pause, session, api_key)
    365     if data_source not in expected_source:
    366         msg = "data_source=%r is not implemented" % data_source
--> 367         raise NotImplementedError(msg)
    368 
    369     if data_source == "yahoo":

NotImplementedError: data_source='Yahoo' is not implemented


PD: My code is exactly the same as the one in the video. I also updated the pandas in the Anaconda's prompt, but didn't work. I also ty another code (import yfinance as yfin
yfin.pdr_override()) and that also didn't work, with that alternative code I got: ModuleNotFoundError: No module named 'yfinance'


Please help me.

3 answers ( 0 marked as helpful)
Super learner
This user is a Super Learner. To become a Super Learner, you need to reach Level 8.
Posted on:

01 Aug 2023

0

Found following solution:

import pandas
from pandas_datareader import data as pdr
import yfinance as yfin
yfin.pdr_override()

df = pdr.get_data_yahoo("PG", start="1995-1-1", end="2023-1-1")
print(df)


Credit : Alok

Posted on:

02 Aug 2023

1

Hi Mayurkumar, 

With that, I got the following error:


ModuleNotFoundError                       Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_5436\199051433.py in <module>
----> 1 import yfinance as yfin

ModuleNotFoundError: No module named 'yfinance'

Posted on:

17 Nov 2023

0

use 'yahoo' instead of 'Yahoo'

Submit an answer