url NotFoundError with quandl

2020-04-19 06:10发布

问题:

Code:

import pandas as pd

import quandl
quandl.ApiConfig.api_key = 'wsnt2aKcnkNMJjdqqwTz'

pd = quandl.get('BATS / BATS_GOOGL')

print(df.head())

Error:

NotFoundError: (Status 400) (Quandl Error QECx01) We could not recognize the URL you requested: /api/v3/datasets/BATS / BATS_GOOGL/data. Please check your URL and try again.

回答1:

You should not use spaces in the path; also, you should not use pd as a variable name (remember, you have imported pandas as pd), plus that, as is now, you are asking for the head() of a dataframe df that is nowhere defined.

Try with

df = quandl.get('BATS/BATS_GOOGL')


标签: python quandl