In [1]:
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
sns.set(color_codes=True)
palette = ("PuBuGn_d")

In [2]:
df = pd.read_csv('csvForGraphs.csv')

In [3]:
title = 'Officer Gender'.title()
plt.title(title)
sns.countplot(x="officer_gender", data=df, palette=palette, saturation=1)
plt.xlabel('Gender')
plt.savefig('Officer_Gender_BarPlt.png')



In [4]:
title = 'Officer Race'.title()
plt.title(title)
sns.countplot(x="officer_race", data=df, palette=palette, saturation=1)
plt.xlabel('Race')
plt.savefig('Officer_Race_BarPlt.png')



In [10]:
title = 'Complainant Race'.title()
plt.title(title)
race = df.copy().sort_values(by='complainant_race', inplace=False)
snsplt = sns.countplot(x='complainant_race', data=df, palette=palette, saturation=1, order=race["complainant_race"].index)
labels = df["complainant_race"].unique()
for item in snsplt.get_xticklabels():
    item.set_rotation(35)
plt.xlabel('Race')
plt.savefig('Complainant_Race_BarPlt.png')



In [ ]:


In [ ]: