This project analyzes the average consumer prices of essential items across major Pakistani cities, using weekly data published by the Pakistan Bureau of Statistics (PBS). The goal is to visualize price changes week-on-week and highlight trends in essential items.
Two Excel files are used in this analysis:
Annex_07.08.2025.xlsx
– Prices for the week ending 07-08-2025SPI-Annex_24.04.2025.xlsx
– Prices for the week ending 24-04-2025
Each file contains average prices of essential items across various cities.
-
Consumer_Prices_Analysis.ipynb
– Jupyter Notebook containing:- Data cleaning and preparation
- Heatmap of previous week's prices
- Heatmap of current week's prices
- Week-on-week comparison heatmap
- Bar-plot showing max price increases and decreases per item
-
data/
– Folder containing the Excel files -
images/
– Folder containing visualizations:previous_week.png
current_week.png
price_changes.png
highlight.png
- pandas – For data cleaning, manipulation, and combining multiple sheets
- matplotlib – For creating plots and heatmaps
- seaborn – For enhanced visualization and color-coded heatmaps
-
Heatmap of Previous Week – Shows average prices of essential items with highest prices highlighted.
-
Heatmap of Current Week – Same as above but for the latest week.
-
Week-on-Week Comparison – Highlights price increases (green) and decreases (red) for easy insight.
-
Bar Plot of Max-Min Prices – Shows the max price increases and decreases per item.
- Clone the repository:
git clone https://github.com/faraz-abbasi/Consumer_Prices_Analysis.git
- Open the Jupyter Notebook (Consumer_Prices_Analysis.ipynb) in Jupyter Lab or VS Code.
- Install the required Python libraries (if not already installed):
pip install pandas matplotlib seaborn openpyxl
- Update the Excel file paths in the notebook if necessary.
- Run the notebook cell by cell to view the visualizations and insights.