geting an empty dataframe after using the example code on googlefinance.client
Asked Answered
H

0

6

I am trying to run the sample code from the googlefinance.client 1.3.0 documentation after I install the package using pip install googlefinance.client

from googlefinance.client import get_price_data, get_prices_data, get_prices_time_data
# Dow Jones param = {
    'q': ".DJI", # Stock symbol (ex: "AAPL")
    'i': "86400", # Interval size in seconds ("86400" = 1 day intervals)
    'x': "INDEXDJX", # Stock exchange symbol on which stock is traded (ex: "NASD")
    'p': "1Y" # Period (Ex: "1Y" = 1 year) }
# get price data (return pandas dataframe) df = get_price_data(param) print(df)

However, instead of getting a dataset of price, i got an empty dataframe

Empty DataFrame
Columns: [Open, High, Low, Close, Volume]
Index: []

How can I fix this? Thanks!

Hebetude answered 21/2, 2018 at 1:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.