Data Analysis with Python and Pandas Tutorial, part 7 from sentdex -
video link here: https://www.youtube.com/watch?v=wkiw0yloqee&index=7&list=plqvvvaa0qudc-3szzjep6n6b0adrrkyl-
i'm having difficult time keeping labels of "state name" columns in code has "for loop" running through "indexed" data gentleman demonstrates through video. i've noticed tutorial close 2 years old, i'm not entirely sure if sort of patch or update preventing code operating
import quandl import pandas pd import pickle api_key = open('c:\\users\\thesalt\\documents\\{apicode}.txt','r').read() fiddy_states=pd.read_html('https://simple.wikipedia.org/wiki/list_of_u.s._states') #print (fiddy_states) main_df = pd.dataframe() 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, lsuffix= '.') print (main_df)
output: a snip of output
any assistance appreciated.
Comments
Post a Comment