Published in

Jungletronics

# How to Calculate Consumer Price Index (CPI) In Python

## Bradstreet, Sauerbeck, Laspeyres and Paasche CPI — #EconoSeries — Episode 00

`How to run SIX Jupyter notebooks with Python code to automaticallyCALCULATE from Excel table these INDEXES:00_BRADSTREET01_SAUERBECK_ARITHMETIC02_SAUERBECK_GEOMETRIC03_SAUERBECK_HARMONIC04_LASPEYRES05_PAASCHEFile: 00_commodities_basket.xlsx`

# What is the Consumer Price Index?

Consumer Price Index (CPI) measures the average price of a basket of commodities commonly used by people relative to a base year. The base year CPI is marked as 100. The CPI for the year in which the measure is calculated is either below or more than 100. Thus, denoting whether the average price has increased or decreased over the period.

`How to run:Download all files to your desktopRun Google ColabLoad Excel file to the same dirLoad each .ipynb fileAnd Enjoy!`

Calculating Consumer Price Index (CPI) involves measuring changes in price levels of a sample of representative goods and services used by the households in an economy over a specific period.

This market basket of commodities is developed based on the information provided by the households regarding their expenditures on different product and service categories.

Calculation of CPI takes two types; CPI for single item and for multiple item. How to calculate the Consumer Price Index (CPI) for single and for multiple item is explained here in detail.

That’s all, folks!

Enjoy!

## Credits & References

Thank you, Mr. Ricardo A. Deckmann Zanardini — You are an Awesome Teacher! o/; Text edited while I’m studying Computer Engineer at Escola Superior Politécnica Uninter🏋!

--

--

--

## More from Jungletronics

J of Jungle + 3 Plats Arduino/RPi/Pic = J3

## J3

Hi, Guys o/ I am J3! I am just a hobby-dev, playing around with Python, Django, Lego, Arduino, Raspy, PIC, AI… Welcome! Join us!