In [1]:
import matplotlib.pyplot as plt
import numpy as np
In [3]:
import pandas as pd

data = pd.read_excel("Group-Training-Male-Cancer-statistics.xlsx")
In [4]:
data
Out[4]:
Unnamed: 0 Male %
0 Prostate 299010 29.0
1 Lung & bronchus 116310 11.0
2 Colon & rectum 81540 8.0
3 Urinary bladder 63070 6.0
4 Melanoma of the skin 59170 6.0
5 Kidney & renal pelvis 52380 5.0
6 Non-Hodgkin lymphoma 44590 4.0
7 Oral cavity & pharynx 41510 4.0
8 Leukemia 36450 4.0
9 Pancreas 34530 3.0
10 All sites 1029080 NaN
In [21]:
Cancers = data['Unnamed: 0']
Number = data['Male']
# The code below deletes the last row of the data so that the chart is accurate.
Number.drop(Number.tail(1).index,inplace=True)
Cancers.drop(Cancers.tail(1).index,inplace=True) 

fig, ax = plt.subplots()
ax.pie(Number, labels=Cancers)
plt.show()

# In the picture that was given there was no prostate cancer so this chart also doesn't have prostate cancer.
Number.drop(Number.head(1).index,inplace=True)
Cancers.drop(Cancers.head(1).index,inplace=True)

fig, ax = plt.subplots()
ax.pie(Number, labels=Cancers)
plt.show()           
No description has been provided for this image
No description has been provided for this image
In [ ]: