Skip to content

pdr.get_data_reader() does not work properly #875

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
samu000000 opened this issue Jul 11, 2021 · 3 comments
Closed

pdr.get_data_reader() does not work properly #875

samu000000 opened this issue Jul 11, 2021 · 3 comments
Milestone

Comments

@samu000000
Copy link

Hi,

I am new to this and hope someone can answer me.
I am trying to the following code but code does not work and I get following error. what is going wrong?
thanks
sale

_


import pandas as pd
import yfinance as yf
import datetime as dt_
from pandas_datareader import data as pdr

yf.pdr_override() # work around for yahoo trade data

start = dt.datetime(2016,1,1)

end = dt.datetime.now()

stocklist = ['AAPL', 'GOOG', 'MFST', 'AMZN']

for stock in stocklist:
print(f"stock = {stock}")

try:

    #df=pdr.get_data_yahoo(stock,start,end)

    df=pdr.get_data_stooq(stock,start,end)

    #df=pdr.get_data_fred(stock,start,end)

    print(df.head())

except:

    print("No data "+ stock)

output:

stock = AAPL

Empty DataFrame

Columns: []

Index: []

stock = GOOG

Empty DataFrame

Columns: []

Index: []

stock = MFST

Empty DataFrame

Columns: []

Index: []

stock = AMZN

Empty DataFrame

Columns: []

Index: []

@samu000000
Copy link
Author

no comments

@datatalking
Copy link

I'm not seeing an error, it looks like you've posted code and output. We will need to know what link this is from and a copy-paste of the actual error will include the phrases like, Stacktrace, Traceback, or look something like this

IndentationError: unindent does not match any outer indentation level

@bashtage
Copy link
Contributor

Consolidating to #867.

@bashtage bashtage added this to the 0.10 milestone Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants