InvalidHeader: Invalid return character or leading space in header: x-api-token

0

I'm studying the tutorial "Data Analysis with Python and Pandas Tutorial" and I'm stuck with the error that I mention in the title. The script that returns this error is the following ..

import quandl
import pandas as pd
# Not necessary, I just do this so I do not show my API key.
api_key = open('quandlapikey.txt','r').read()
fiddy_states = pd.read_html('https://simple.wikipedia.org/wiki/List_of_U.S._states')

main_df = pd.DataFrame()

for abbv in fiddy_states[0][0][1:]:
    query = "FMAC/HPI_"+str(abbv)
    df = quandl.get(query, authtoken=api_key)

    if main_df.empty:
        main_df = df
    else:
        main_df = main_df.join(df)

I will appreciate help to solve this problem and be able to continue this study.

    
asked by efueyo 16.09.2018 в 01:34
source

0 answers