Converting Percentages to CPI Values
Learn how to convert percentages to CPI values and how to create a Python function for converting data.
We'll cover the following...
How to convert data
Well, that’s our formatting problem out of the way: we’ve
converted the CPI data to quarterly increments and cleaned
up the Date
format to match the wages data. Now we’ll need to
address the inconsistency between the absolute point values
in the CPI set and the percentages that came with the wages
data.
Wages
Press + to interact
import pandas as pdimport matplotlib as pltimport numpy as npimport blswages = bls.get_series('CIU2020000000000A')wages.to_csv('bls_data_csv')df = pd.read_csv('bls_data_csv')df.columns = 'Date','Wages'print (df)
-
Get that data: First, let’s get that data. Technically, if you’ve been following along on your own, you’ll already have pulled the series back ...