Analyzing Nigeria’s Food Prices (2018-2022) – A Terra Bootcamp Project
Introduction
Food prices in Nigeria have fluctuated significantly between 2018 and 2022, influenced by inflation, economic policies, and supply chain factors. As part of Terra Bootcamp, my team analyzed food price data alongside inflation trends to uncover key insights.
In this project, we used Python (Pandas, Power Bi, Matplotlib) to clean, visualize, and analyze the data, providing recommendations for policymakers and stakeholders.
Data Collection & Cleaning
We worked with two datasets:
• Food Prices Dataset (2018-2022) 📊
• Inflation Data for the same period 📈
Loading the Data in Python:
import pandas as pd
# Load the datasets
df_food = pd.read_excel("Food_Prices.xlsx")
df_inflation = pd.read_excel("Inflation_Data.xlsx")
# Convert date columns to datetime format
df_food["date"] = pd.to_datetime(df_food["date"])
df_inflation["date"] = pd.to_datetime(df_inflation["date"])
# Extract Year and Month for analysis
df_food["Year"] = df_food["date"].dt.year
df_food["Month"]=df_food["date"].dt.month
Exploratory Data Analysis (EDA)
1. Food Price Trends Over Time
To understand how food prices changed over the years, we plotted a line chart showing trends for key commodities.
import matplotlib.pyplot as plt
import seaborn as sns
# Plot food price trends over time
plt.figure(figsize=(12, 6))
sns.lineplot(x=df_food["date"], y=df_food["usdprice"], hue=df_food["commodity"])
plt.xlabel("Year")
plt.ylabel("Average Price (USD)")
plt.title("Food Price Trends in Nigeria (2018-2022)")
plt.show()
Checking for Missing Values:
import pandas as pd
path = “wfp_food_prices_nga.csv"
result = pd.read_csv(path)
q = result.isnull()
for i in Q:
if i == True:print(i)
else:print(“No Empty Value Found")
Chart Visualizations using Power Bi 📈:
Key Findings & Insights
• Food prices have been rising consistently, mirroring inflation trends.
• Inflation has a strong positive correlation with the increase in food prices.
• There are significant regional differences in food prices, suggesting logical and production related challenges.
Conclusion & Recommendations
• Short-Term Actions: Price monitoring, targeted subsidies and market stabilization.
• Long-Term Strategies: Agricultural investment, exchange rate stabilization and food security programs.
#DataAnalytics #FoodPrices #NigeriaEconomy #Inflation #BigData #DataScience #TerraBootcamp #EconomicTrends #Hashnode