Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

World’s 2009 Financial

Crisis
Gerardo Hernández Galaviz
Dataset(s)
The used dataset was:

- World Development Indicators Dataset


Motivation
The world is walking steadily towards a financial crisis due to COVID-19 pandemic
and it’s important to know which countries will be impacted the most. The last
crisis was in 2009 and the GDP results from that year can reveal which countries
will require more support because of their susceptibility to receive the most
negative economic impact.
Research Question(s)
Do wealthier countries (higher GDP per capita) were less impacted in their growth
during the last financial crisis of 2009?
Findings
The 2009 data for GDP per capita was plotted
vs GDP growth to find any correlation between
the variables.

The graph shows a high number of countries


with negative growth for that year and what it
seems to be a negative correlation.
Findings
To confirm the findings on the graph, the
Pearson correlation was run for the 2 variables.
The result was a moderate negative correlation
between the 2 variables.

Also, values were sorted to look at the outliers:


who fared the best and worst. The economies
that did worst were developing economies in
Europe and the ones that performed best were
economies in Middle East.
Findings
We can conclude that, the financial crisis had a worst impact over wealthier
countries, probably related to the nature of the root cause of the crisis (financial
services related to highly developed economies). However, it is important to
acknowledge the ripple effects that the crisis had over small countries with
developing economies in Europe.
Acknowledgements
The results presented in this document is product of my own analysis. I recognize
that the work can further be improved with external input from colleagues.
References
Pearson correlation explanation:

https://www.statisticssolutions.com/pearsons-correlation-
coefficient/#:~:text=Pearson's%20correlation%20coefficient%20is%20the,on%20t
he%20method%20of%20covariance.
3/6/2021 FinancialCrisis2009

Do
werewealthier
less countries
impacted in (higher
their GDP
growth per capita)
during the
last financial crisis of 2009?
In [1]: import pandas as pd
import numpy as np
import random
import matplotlib.pyplot as plt

In [2]: data = pd.read_csv('/Users/gerardohernandez/OneDrive/Documentos/Data Science Mic


data.shape

Out[2]: (5656458, 6)

In [3]: #Obtain a data frame with the GDP growth of all countries in 2009
GDPgrowth = data.copy()
filter_GDPgrowth = (GDPgrowth['IndicatorName']=="GDP growth (annual %)") & (GDPg
GDPgrowth = GDPgrowth.loc[filter_GDPgrowth]

In [4]: #Obtain a data frame with the GDP per capita of all countries in 2009
GDP = data.copy()
filter_GDP = (GDP['IndicatorName']=="GDP per capita (current US$)") & (GDP['Year
GDP = GDP.loc[filter_GDP]

In [5]: #Perform a join operation between the 2 dataframes to obtain an equal number of
#per capita
GDPvsGrowth=GDPgrowth.set_index('CountryName').join(GDP.set_index('CountryName')

#Delete unnecesary columns


del GDPvsGrowth['CountryCode_GDP']
del GDPvsGrowth['IndicatorName_growth']
del GDPvsGrowth['IndicatorName_GDP']
del GDPvsGrowth['Year_growth']
del GDPvsGrowth['Year_GDP']
del GDPvsGrowth['IndicatorCode_growth']
del GDPvsGrowth['IndicatorCode_GDP']

In [6]: #Do a scatter plot to see the correlation between the 2 variables
#By looking at the graph, one can perceive that higher income countries performe
fig, axis = plt.subplots(figsize=(10, 10))

axis.yaxis.grid(True)
axis.set_title('GDP per capita vs GDP growth in 2009 (financial crisis)',fontsiz
axis.set_xlabel('GDP growth (annual %)',fontsize=12)
axis.set_ylabel('GDP per capita (constant 2005 US$)',fontsize=12)

X = GDPvsGrowth['Value_growth']
Y = GDPvsGrowth['Value_GDP']

axis.scatter(X, Y)
plt.show()

localhost:8888/nbconvert/html/OneDrive/Documentos/Data Science MicroMasters/Week-6-MiniProject/FinancialCrisis2009.ipynb?download=false 1/3


3/6/2021 FinancialCrisis2009

In [7]: #Check the correlation of the variables


#The result shows that there's a negative and moderate degree of correlation bet
#on 2019. Meaning that wealthier countries were more impacted by the nature of t
GDPvsGrowth.corr(method="pearson")

Out[7]: Value_growth Value_GDP


Value_growth 1.000000 -0.346913
Value_GDP -0.346913 1.000000

In [8]: #Perform a sort to see which where the countries that had the biggest impact on
#The worst impact was on developing economies in Europe. And the highest increas
GDPvsGrowth.sort_values(by='Value_growth')

Out[8]: CountryCode_growth Value_growth Value_GDP


CountryName
Lithuania LTU -14.814163 11837.391027
localhost:8888/nbconvert/html/OneDrive/Documentos/Data Science MicroMasters/Week-6-MiniProject/FinancialCrisis2009.ipynb?download=false 2/3
3/6/2021 FinancialCrisis2009

CountryCode_growth Value_growth Value_GDP


CountryName
Ukraine UKR -14.800000 2545.480341
Estonia EST -14.724402 14726.313906
Latvia LVA -14.348926 12207.587067
Armenia ARM -14.149989 2915.583906
... ... ... ...
Lebanon LBN 10.300913 8403.109316
Qatar QAT 11.956561 61463.903582
Timor-Leste TMP 12.962963 780.261111
West Bank and Gaza WBG 20.940788 1963.201519
Afghanistan AFG 21.020649 458.955782
226 rows × 3 columns
In [ ]:

localhost:8888/nbconvert/html/OneDrive/Documentos/Data Science MicroMasters/Week-6-MiniProject/FinancialCrisis2009.ipynb?download=false 3/3

You might also like