The world’s leading publication for data science, AI, and ML professionals.

Climate Change and Food Scarcity in Developing Regions: An Analysis in Python

One of the most important environmental issues discussed today is global warming. This is due to the impacts our warming climate has on…

Photo by Pixabay on Pexels
Photo by Pixabay on Pexels

One of the most important environmental issues discussed today is global warming. This is due to the impacts our warming climate has on crop yields, weather patterns, sea levels, wildfire incidents, and ecological systems. Global temperatures have risen at a faster rate than at any time since records began to be kept in the 1850s, and temperatures are expected to increase by another 1.8 to 5.8°C by the end of this century. Global warming is caused by the emission of greenhouse gases like carbon dioxide, methane, water vapor, chlorofluorocarbons and nitrous oxide.

Source
Source

These gases have an insulating effect on the climate which causes the atmosphere to trap heat and warm the earth. Many of these gases are released from factory farming, car exhaust, airplane exhaust, and fossil fuel extraction.

If we don’t tackle the issue of Climate Change quickly, ecosystems will continue to be disrupted, sea levels will continue to rise, and crop yields (food production) will decrease. Regarding food production, crop weeds, insects and pest infestations are projected to rise as a result of the warming climate.

Climate change may have detrimental consequences for developing countries where decreased food production may result in increased malnutrition, population displacement, and disease propagation due to overcrowding.

Source
Source

Additionally, the World Health Organization (WHO) claims that for infectious diseases climate change is a threat multiplier:

It takes existing threats – whether from a cholera outbreak, the spread of Zika to new geographical areas, or the severe malnutrition that accompanies drought – and enhances them. The risks are familiar but their impact is amplified in frequency and severity. A changing climate can expand the distribution of infectious diseases, especially those transmitted by mosquitoes and other vectors, and invite the emergence of others. The emergence of Nipah virus and Hanta virus as human pathogens has been traced to extreme weather events that forced animal hosts to leave their ecological niches and invade human settlements.

Yale Climate Connection also states:

In addition, rising temperatures can alter exposures to some pathogens and toxins. Consider: Salmonella, Campylobacter, Vibrio parahaemolyticus in raw oysters, and mycotoxigenic fungi, which can all potentially thrive in warmer environments. More carbon dioxide in the atmosphere also can decrease dietary iron, zinc, protein, and other macro- and micronutrients in certain crops.

Given the future implications of climate change on food production and disease propagation, public education on the impacts of climate change is crucial. In this post we will perform simple exploratory analysis of public climate change data provided by datahub and global crop yield data provided by ourworldindata.org. In another post, we will take a closer look at some infectious disease data.

We start by importing the Python library Pandas:

import pandas as pd

The first dataset we will look at it is the annual global temparature data. We can read the data into a dataframe and print the first five rows:

df_global_temp = pd.read_csv("annual_temp.csv")
print(df_global_temp.head())

Next we can filter our data so that we only get records corresponding to the NASA GISTEMP source:

df_global_temp = df_global_temp[df_global_temp['Source'] == 'GISTEMP'].reset_index()[["Source", "Year", "Mean"]]
print(df_global_temp.head())

Next we can plot the mean annual temperature vs. time. We proceed by importing the python visualization package ‘seaborn’ and making a line plot of the time series:

import seaborn as sns
sns.set()
sns.lineplot(df_global_temp['Year'], df_global_temp['Mean'])
plt.ylabel("Mean")
plt.title("Average Global Mean Temperature")

Next we can look at the annual global production of rice and wheat provided by ourworldindata.org. Let’s read the ‘rice-yield.csv’ data into a dataframe and look at the first five rows:

df_rice = pd.read_csv("rice-yields.csv")
df_rice.head()

We can also look at the unique set of regions:

from collections import Counter
print(set(df_rice['Entity'].values))
print("NUMBER OF REGIONS: ", len(set(df_rice['Entity'].values)))
Countries in the Rice Yield Data set
Countries in the Rice Yield Data set

There are a total of 148 regions. Knowing that developing regions are more vulnerable to the risks that climate change pose, it would be useful to narrow our scope. Time Magazine stated Nigeria, Haiti, Yemen, Philippines and Fiji will face the most severe consequences of climate change.

With that in mind we can start by looking at rice production in Nigeria:

df_rice = pd.read_csv("rice-yields.csv")
df_rice = df_rice[df_rice['Entity']=='Nigeria'].reset_index()[["Entity", "Code", "Year", ' (tonnes per hectare)']]
print(df_rice.head())

Next we can plot the crop yield for rice in Nigeria from 1960–2014:

sns.lineplot(df_rice['Year'], df_rice[' (tonnes per hectare)'])
plt.ylabel("Rice Production in Nigeria (tonnes per hectare)")
plt.title("Annual Rice production in Nigeria")

Next we can overlay the global annual mean temperature and the crop yields for rice in Nigeria:

sns.set()
sns.lineplot(df_global_temp['Year'], df_global_temp['Mean'])
plt.ylabel("Mean")
plt.title("Average Global Mean Temperature and rice production in Nigeria")

sns.lineplot(df_rice['Year'], df_rice[' (tonnes per hectare)'])
plt.ylabel("Mean temperature/tonnes per hectare rice in Nigeria ")

Interestingly enough, there seems to be a significant drop in rice production in Nigeria between 1987 and 2006.

We can also look at rice production in Haiti:

df_rice = pd.read_csv("rice-yields.csv")
df_rice = df_rice[df_rice['Entity']=='Haiti'].reset_index()[["Entity", "Code", "Year", ' (tonnes per hectare)']]
print(df_rice.head())

And we can look at it overlaid with the climate data:

There also seems to be a slight drop in rice production in Haiti.

We can also look at the same plots for wheat production in Nigeria:

df_wheat = pd.read_csv("wheat-yields.csv")
df_wheat = df_wheat[df_wheat['Entity']=='Nigeria'].reset_index()[["Entity", "Code", "Year", ' (tonnes per hectare)']]
print(df_rice.head())
sns.set()
sns.lineplot(df_global_temp['Year'], df_global_temp['Mean'])
plt.ylabel("Mean")
plt.title("Average Global Mean Temperature and wheat production in Nigeria")
sns.lineplot(df_wheat['Year'], df_wheat[' (tonnes per hectare)'])
plt.ylabel("Mean temperature/tonnes per hectare wheat in Nigeria ")

Again, there seems to be a downward trend in wheat production in Nigeria with increase in yearly global temperature.

A much more exhaustive analysis would be required to draw any conclusions from the data at this point, but so far our analysis seems to be in concert with what has been reported in the literature. We will conclude our analysis here but feel free to look at crop yields in other regions as well as some of the other climate change data available on datahub.

As stated before, in addition to impacting crop yields, scientists believe climate change is having an impact on the spread of infectious diseases. In the next post we will analyze publicly available infectious disease data along with the the climate change data and see if we detect any trends. The datasets and code in this post are available on GitHub. Thank you for reading!


Related Articles