<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Table of Contents
<p><div class="lev1 toc-item"><a href="#Project-1
Step1:  The data
The data consists of total population and total number of deaths due to TB (excluding HIV) in 2013 in each of the BRICS (Brazil, Russia, India, China, South Africa) and Portuguese-speaking countries. 
The data was taken in July 2015 from http
Step2:  The range of the problem
The column of interest is the last one.
Step3:  The total number of deaths in 2013 is
Step4:  The largest and smallest number of deaths in a single country are
Step5:  From less than 20 to almost a quarter of a million deaths is a huge range. The average number of deaths, over all countries in the data, can give a better idea of the seriousness of the problem in each country.
The average can be computed as the mean or the median. Given the wide range of deaths, the median is probably a more sensible average measure.
Step6:  The median is far lower than the mean. This indicates that some of the countries had a very high number of TB deaths in 2013, pushing the value of the mean up.
The most affected
To see the most affected countries, the table is sorted in ascending order by the last column, which puts those countries in the last rows.
Step7:  The table raises the possibility that a large number of deaths may be partly due to a large population. To compare the countries on an equal footing, the death rate per 100,000 inhabitants is computed.
<ASSISTANT_TASK:>
Python Code:
# Print platform info of Python exec env.
import sys
sys.version
import warnings
warnings.simplefilter('ignore', FutureWarning)
from pandas import *
show_versions()
Explanation: Table of Contents
<p><div class="lev1 toc-item"><a href="#Project-1:-Deaths-by-tuberculosis" data-toc-modified-id="Project-1:-Deaths-by-tuberculosis-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Project 1: Deaths by tuberculosis</a></div><div class="lev2 toc-item"><a href="#Env" data-toc-modified-id="Env-11"><span class="toc-item-num">1.1&nbsp;&nbsp;</span>Env</a></div><div class="lev2 toc-item"><a href="#The-data" data-toc-modified-id="The-data-12"><span class="toc-item-num">1.2&nbsp;&nbsp;</span>The data</a></div><div class="lev2 toc-item"><a href="#The-range-of-the-problem" data-toc-modified-id="The-range-of-the-problem-13"><span class="toc-item-num">1.3&nbsp;&nbsp;</span>The range of the problem</a></div><div class="lev2 toc-item"><a href="#The-most-affected" data-toc-modified-id="The-most-affected-14"><span class="toc-item-num">1.4&nbsp;&nbsp;</span>The most affected</a></div><div class="lev2 toc-item"><a href="#Conclusions" data-toc-modified-id="Conclusions-15"><span class="toc-item-num">1.5&nbsp;&nbsp;</span>Conclusions</a></div>
# Project 1: Deaths by tuberculosis
by Michel Wermelinger, 14 July 2015, with minor edits on 5 April 2016<br>
This is the project notebook for Week 1 of The Open University's [_Learn to code for Data Analysis_](http://futurelearn.com/courses/learn-to-code) course.
In 2000, the United Nations set eight Millenium Development Goals (MDGs) to reduce poverty and diseases, improve gender equality and environmental sustainability, etc. Each goal is quantified and time-bound, to be achieved by the end of 2015. Goal 6 is to have halted and started reversing the spread of HIV, malaria and tuberculosis (TB).
TB doesn't make headlines like Ebola, SARS (severe acute respiratory syndrome) and other epidemics, but is far deadlier. For more information, see the World Health Organisation (WHO) page <http://www.who.int/gho/tb/en/>.
Given the population and number of deaths due to TB in some countries during one year, the following questions will be answered: 
- What is the total, maximum, minimum and average number of deaths in that year?
- Which countries have the most and the least deaths?
- What is the death rate (deaths per 100,000 inhabitants) for each country?
- Which countries have the lowest and highest death rate?
The death rate allows for a better comparison of countries with widely different population sizes.
## Env
End of explanation
data = read_excel('WHO POP TB some.xls')
data.head()
data.tail()
data.info()
data.describe()
Explanation: The data
The data consists of total population and total number of deaths due to TB (excluding HIV) in 2013 in each of the BRICS (Brazil, Russia, India, China, South Africa) and Portuguese-speaking countries. 
The data was taken in July 2015 from http://apps.who.int/gho/data/node.main.POP107?lang=en (population) and http://apps.who.int/gho/data/node.main.593?lang=en (deaths). The uncertainty bounds of the number of deaths were ignored.
The data was collected into an Excel file which should be in the same folder as this notebook.
End of explanation
tbColumn = data['TB deaths']
Explanation: The range of the problem
The column of interest is the last one.
End of explanation
tbColumn.sum()
Explanation: The total number of deaths in 2013 is:
End of explanation
tbColumn.max()
tbColumn.min()
Explanation: The largest and smallest number of deaths in a single country are:
End of explanation
tbColumn.mean()
tbColumn.median()
Explanation: From less than 20 to almost a quarter of a million deaths is a huge range. The average number of deaths, over all countries in the data, can give a better idea of the seriousness of the problem in each country.
The average can be computed as the mean or the median. Given the wide range of deaths, the median is probably a more sensible average measure.
End of explanation
data.sort_values('TB deaths').head()
Explanation: The median is far lower than the mean. This indicates that some of the countries had a very high number of TB deaths in 2013, pushing the value of the mean up.
The most affected
To see the most affected countries, the table is sorted in ascending order by the last column, which puts those countries in the last rows.
End of explanation
populationColumn = data['Population (1000s)']
data['TB deaths (per 100,000)'] = tbColumn * 100 / populationColumn
data.head()
Explanation: The table raises the possibility that a large number of deaths may be partly due to a large population. To compare the countries on an equal footing, the death rate per 100,000 inhabitants is computed.
End of explanation
<END_TASK>