pandas_pickling_sentdex.py 445 B

1234567891011121314151617
  1. import quandl
  2. import pandas as pd
  3. # Not necessary, I just do this so I do not show my API key.
  4. api_key = 'rFsSehe51RLzREtYhLfo'
  5. fiddy_states = pd.read_html('https://simple.wikipedia.org/wiki/List_of_U.S._states')
  6. main_df = pd.DataFrame()
  7. for abbv in fiddy_states[0][0][1:]:
  8. query = "FMAC/HPI_"+str(abbv)
  9. df = quandl.get(query, authtoken=api_key)
  10. if main_df.empty:
  11. main_df = df
  12. else:
  13. main_df = main_df.join(df)