简体   繁体   中英

Python 2.7 in anaconda: cannot import yahoo finance data with panda

I am trying to import a basic stock quote using panda in python 2.7.

Any help on why this code will not work?

The error I get is: SyntaxError: invalid syntax

Code:

import pandas as pd

from pandas_datareader import data

data.DataReader('GOOG', 'yahoo', '2016-06-01', '2016-10-26')

Try this

In [1]: import pandas_datareader.data as web

In [2]: import datetime

In [3]: start = datetime.datetime(2016, 06, 01)

In [4]: end = datetime.datetime(2013, 10, 26)

In [5]: f = web.DataReader('F', 'yahoo', start, end)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM