You are on page 1of 14

BANGLADESH UNIVERSITY OF PROFESSIONALS

Term Paper

Task: Using the dataset, present the new finding and compare the GDP, Life expectancy as
well as population for at least five countries.

Submitted to
Md. Abdur Rahman.
Professor of Computer Sciences,
Department of Mathematics,
Jahangirnagar University

Submitted by
Khondokar Kaif Noor Hassan, ID:2225171133
Muntasir Haque, ID:2225171017
Naqvi Munir Meemo, ID;2225171007

1|Page
ACKNOWLEDGEMENT

Firstly, we would like to thank Almighty Allah for blessing us with the ability to successfully
complete the term paper that has been given to us and we were able to submit it timely.

Secondly, The completion of this paper could not have been possible without the participation of
our fellow group members for the dedication of their time and concentration towards the paper.
Their contributions are sincerely acknowledged. Our Unity made it possible to finish this paper.

Last but not least, our gratitude goes toward our course instructor, Prof. Md. Abdur Rahman.
For guiding and mentoring our group in achieving our objective. We would like to thank him for
giving us this opportunity to have insight into the python programming language. Its structure
and how it operates are the aspects that are familiar to us.

2|Page
LETTER OF TRANSMITTAL

The Course Instructor Date:


Md. Abdur Rahman.
Professor of Computer Sciences,
Department of Mathematics,
Jahangirnagar University

Subject: Computational Thought on Business Term paper

Dear Sir,

We are pleased to submit our Computational Thought on the Business term paper. This letter signifies the
submission of our term paper.

Although we are still on the learning curve, this report has enabled us to gain insight into the core of the
python programming language. Therefore, it has become a challenging and interesting experience. Thank
you for your consideration of the idea. Hope that you will acknowledge the effort that we have shown in
this paper. However, we understand that our work is not perfect, thus, we welcome any criticism you
might have for our work.

Sincerely,

Khondokar Kaif Noor Hasan (2225171133)


Muntasir Haque (2225171017)
Naqvi Munir Meemo(2225171007)

3|Page
DECLARATION

We hear by declaring that this computational thought on a business term paper is a product of our day and
night effort under the guidance of the course instructor, Prof. Md. Abdur Rahman.

The report has been duly submitted to the Faculty of Business Studies, Department of Business
Administration in Marketing at Bangladesh University of Professionals. It is a partial fulfillment of the
first-semester final examination 2022 for the course of Computational Thought on Business.

We further declare that the work projected in this report has not been previously submitted in this or any
other institute.

Place: Mirpur Cantonment, Dhaka.

Date: 3rd November 2022.

4|Page
Table of contents
1.0 Abstract:……………………………………………………06
2.0 Introduction:………………………………………………07
3.0 Dataset:………………………………………………………08
4.0 Implementation…………………………………………09
5.0 Conclusion………………………………………………….14

5|Page
1.0 Abstract:
This paper aims to show how to use the Python Language in organizing scattered data into a
structured form. We have taken the data of 5 countries from the given dataset to find their
respective population, life expectancy, and GDP. In the introduction, we introduced some of the
basic concepts of python programming language. In the dataset, we talked about the Gapminder
dataset that we are using in this paper and what it contains. In the implementation part, we have
shown the practical process of the implementation of the code and its functions. In the
conclusion, we gave our concluding thought on the overall paper and its aspects.

In this paper, we have shown how to use Python codes to form the data and how to implement it.

6|Page
2.0 introduction:
Python is a high-level programming language that is object-oriented and easily
interpreted due to its dynamic semantics. In structure, it is built at a high-level data
structure which is combined with dynamic typing and binding and it is also popular for
rapid application development. It is also useful for scripting or connecting existing
components together. Python is very simple and not difficult to learn as it reduces the
cost of programming maintenance and also gives easy access to readability. It is often
encouraged to use Python as it provides useful support modules.

Pandas Library is an open-source tool used for manipulation and data analysis, which is
built on the top of Pythons programming language. It can be also used for machine
learning tasks. Numpy is another package on which the Pandas library is based. It
provides aid for multidimensional arrays. Other data science modules work well on
Pandas.

Matplotlib is a library for data visualization and graphical plotting for Python. It is also
used for NumPy which is the numerical extension of Python. It is structured so that a few
lines of code can showcase a visual plot.

Google Collab allows anybody to write and execute Python codes using just the Browser.
A collab is a short form of Collaboratory. It is especially well-suited for education,
machine learning, and data analysis. It is free of charge for anyone to use. Here Python
coding can be done without installing any sort of software.

In this paper, we will show the collected data and represent it in its organized form and
compare various subjects and their derivatives. We will portray how each subject and its
derivatives change over the course of the years and how we used the Python language to
organize the data into an organized form.

7|Page
3.0 Dataset:
The dataset we are using here is the ‘Gapminder’ dataset. By using this dataset we did codes and
presented graphs in this paper and compare the population, GDP, and life expectancy of the
countries.
We can see that in the dataset there are countries, continents, years, life expectancy, pop, and
GDP per cap. Now in Countries, we can see Afghanistan, Albania, Algeria, Angola, Argentina,
Iraq, and so on. Continents like Africa, Asia, the Americas, Europe, and some more have been
shown. The year has been discussed till 2007. Life Expectancy for example 28.8010f
Afghanistan in Asia Continent. Pop has been shown for example 1282697 is the Pop of Albania
of Europe Continent. And lastly, a list of GDP per cap has been listed where the information of
all the countries has been shown accordingly.

For example, 853.10071 is the GDP per cap of Afghanistan in the Asia continent. In this way list
of every section has been listed in a proper way with according information and data. And the
total complete list constitutes the dataset of the term paper.

8|Page
4.0 Implementation:
In the implementation, we will show how Python codes are implemented to form organized
graph data. We can turn unorganized data into an organized form using Python language codes.
Here we have the data of many countries from the given dataset. From here we can see that each
country has data on its respective GDP, life expectancy, and population. Over here we have
selected five countries from the dataset and used the Python software to find the average of each
country’s GDP, life expectancy, and population.

Figure 1: The Head of The Data frame showing the first five rows

In the above, the pandas library as well a Matplot library are imported as ‘pd’ for Pandas and
‘plt’ for matplotlib. ‘df=pd.read_csv()’ is used for using the required data frame. After inputting
the location of the gapminder.tsv dataset, setting skip on bad lines and ‘/t’ on the separator. We
used ‘df. head ()’ data frame head in order to present the first 5 rows of the data frame from the
gapminder. Thus, here in the output, we get the life expectancy, pollution, and GDP percentage
of Afghanistan through the different years from the first five rows of the dataset.

9|Page
Figure 2: The Tail of The Data frame showing the last five rows

Through the use of the data frame tail, we are able to output the last 5 rows of the gapminder
dataset.

Here df.tail() is used instead of df.head(). So, this time the data frame only shows the last five
rows. In the output, we can see the life expectancy, the population and GDP percentage of the
country Zimbabwe whose continent is in Africa. Through the different years, we can see the
change of the population, the life expectancy and the GDP percentage of the country.

10 | P a g e
In the above, we used df.loc[] in order to locate Afghanistan from the data frame ‘country’. Then in order
to find the average life expectancy of the country, we used

lifeMeanAfganistan=afganistan['lifeExp'].mean()

Then using the same method, we calculated the mean of the other countries like Albania, Argentina,
Australia and Bahrain. For example,

al=df.loc[df['country'] == 'Albania']
lifeMeanAl=al['lifeExp'].mean()
Here al is used as an acronym for Albania. Following Argentina as ar, Australia as au, and Bahrain as ba.
After inputting the required code of all five countries, we used plt.title() in order to use the title on the
graph then used plt.bar to output the required five countries and their average life expectancies in the
graph. In the end, plt.show() is used to showcase the graph.

11 | P a g e
In the above, we use the codes to find the average population of the five countries from 1957 to 2007.
In order to find the mean of the population of Afghanistan, we used

pAfganistan=afganistan['pop'].mean()
here ‘pop’ is an acronym for the population. ‘pAfganistan’ is equal to the average population of
Afghanistan .Following the same procedure, we found out the mean of other 4 countries

pAl=al['pop'].mean()
here, al is used as an acronym for Albania. Therefore, pAl is equal to the average population of Albania.
In the same way, acronyms are used for other countries. For instance, Argentina is ar, Australia is au, and
Bahrain is ba. ‘plt.title()’ is used to input the title and ‘plt.scatter()’ is used to show the scatter plot in the
graph using the mean of the population of the countries. Finally,’plt.show’ is for showing the result of the
codes.

12 | P a g e
Here, we compare the average GDP percentage of the five countries from 1952 to 2007. To find out the
average of Afghanistan we use,

gAfganistan=afganistan['gdpPercap'].mean()
this code is used specifically for Afghanistan in order to the Average GDP from the Gapminder dataset.
The same procedure is followed for other countries except for the acronyms used. For example,

gAl=al['gdpPercap'].mean()
Al for Albania and likewise AR for Argentina, AU for Australia, and BA for Bahrain.
After the input of the average GDP of five countries, ‘plt.plot’ is used for plotting the required GDP
average of the five countries and ‘plt.show’ is used to showcase the graph as output.
Collab Link: https://colab.research.google.com/drive/1DuwvNJDEhyjLlyRpq80U44lwGYn2MbV_?
usp=sharing#scrollTo=KqI6P9Va53ES

13 | P a g e
5.0 Conclusion:

The term paper was about using the dataset, presenting the new finding, and comparing the GDP,
Life expectancy as well as population for at least five countries. And from the above discussion,
we can see the whole solution to the question asked. In the above discussion, we have discussed
the implementation of the term paper. We have also described the dataset. And in the
implementation section, the whole point is discussed using the code python and thus the
expected objective has been achieved. So, from the above discussion, we have got the whole idea
about the python code to organize the graph data of the term paper. Thus, the importance of
python language to solve a such problem has been discussed accordingly and thus we have
completed the term paperwork with the proper code shown for the graph data.

14 | P a g e

You might also like