# The usual preamble %matplotlib inline import pandas as pd import matplotlib.pyplot as plt # Make the graphs a bit prettier, and bigger pd.set_option('display.mpl_style', 'default') # This is necessary to show lots of columns in pandas 0.12. # Not necessary in pandas 0.13. pd.set_option('display.width', 5000) pd.set_option('display.max_columns', 60) plt.rcParams['figure.figsize'] = (15, 5) complaints = pd.read_csv('../data/311-service-requests.csv') complaints complaints['Complaint Type'] complaints[:5] complaints['Complaint Type'][:5] complaints[:5]['Complaint Type'] complaints[['Complaint Type', 'Borough']] complaints[['Complaint Type', 'Borough']][:10] complaints['Complaint Type'].value_counts() complaint_counts = complaints['Complaint Type'].value_counts() complaint_counts[:10] complaint_counts[:10].plot(kind='bar')