-
Notifications
You must be signed in to change notification settings - Fork 104
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
can not fetch google nor yahoo data by pandas data reader #5
Comments
Hi YX, Thanks for reaching out. What was the error that you received? Thanks! |
Hi,
Here is my workaround: The only issue with that, it doesn't return the 'Adj Close' value, so I had to remove this string from the aggregation part. Here is the solution that works for me: from pandas_datareader import data
def get_stock_info(stock, start, end, source='morningstar'):
df = data.DataReader(stock, source, start, end)
df['Stock'] = stock
agg = df.groupby('Stock').agg({
'Open': ['min', 'max', 'mean', 'median'],
'Close': ['min', 'max', 'mean', 'median'],
'High': ['min', 'max', 'mean', 'median'],
'Low': ['min', 'max', 'mean', 'median'],
})
agg.columns = [' '.join(col).strip() for col in agg.columns.values]
return agg.to_json() Hope that helps. Thanks |
Morningstar is now discontinued per: You can still go to Morningstar's site and sign up for API access, but pandas_datareader has no input I can see for a Morningstar key. The IEX source seems to work (in general, I haven't tested this course's code with it yet), use 'iex'. |
'iex' works if you change the column names to use lower case and the 'Adj close' to 'close'. |
Hi,
|
I'm having the same issue as @ajatau #5 (comment) |
Hi Kjam,
I have issue when try to fetch the finance data.
it seems like some authority issue, not sure if you have encountered it and got it resolved.
Best regards,
YX
The text was updated successfully, but these errors were encountered: