Skip to content

Instantly share code, notes, and snippets.

@benjaminmgross
Last active August 29, 2015 14:05
Show Gist options
  • Save benjaminmgross/8a86395ee9c8a6a06f79 to your computer and use it in GitHub Desktop.
Save benjaminmgross/8a86395ee9c8a6a06f79 to your computer and use it in GitHub Desktop.
Using the Billion Prices Project to Get Daily Inflation Data

##Turning The Billion Prices Data Series into Actual Inflation Data

They keep the data in tough to reach nooks... but I gotcha..

data_url = 'https://globalmarkets.statestreet.com/Proxy/Public/csv/US_monthly_series.csv'
bpp = pandas.DataFrame.from_csv(data_url)

#data is "monthly" and in points, but needs to be converted into daily
apr = bpp/100.*12

#now create the index that is compounding daily
fig = plt.figure(facecolor = '#f3f3f3')
ax = plt.subplot2grid((1,1), (0,0))
(100*(1. + apr/252.).cumprod()).plot(ax = ax, lw = 1, color = 'r')
plt.grid(ls = '-', lw = 0.25, color = '#353535')
plt.title('Daily Price Index from BPP', fontsize = 24)
plt.show()

bpp_repl Now you should have something that compares pretty closely to what you see here for the "Daily Online Price Index."

###From Actual BPP Webpage (Screenshot)

actual_bpp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment