text_plain_output_1.png image_output_1.png
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

## Rate of crimes solved
solved = pd.DataFrame(data, columns = ['Crime Solved']) 
resolution = solved.stack().value_counts()
ax = resolution.plot(kind = 'pie',
                              title = 'Crimes solved between 1980 & 2014 (in %)',
                              startangle = 10,
                              autopct='%.2f')
ax.set_ylabel('')

#Gender of victims
sex = pd.DataFrame(data, columns = ['Victim Sex']) 
count_sex = sex.stack().value_counts()
ax = count_sex.plot(kind = 'pie',
                              title = 'Sex of the victims',
                              startangle = 10,
                              autopct='%.2f')
ax.set_ylabel('')

race = pd.DataFrame(data, columns=['Victim Race'])
count_race = race.stack().value_counts()
ax = count_race.plot(kind='pie', title='Race of the victims', startangle=10, autopct='%.2f', explode=(0, 0, 0.7, 1, 1.3))
ax.set_ylabel('')