application_vnd.jupyter.stderr_output_1.png
import numpy as np

import pandas as pd

nRecords = 200000
snRecords = 1000
maindf = pd.read_csv('../input/database.csv')

maindf.drop(['Year', 'Month', 'Incident', 'City', 'Agency Name', 'Agency Type', 'Record Source', 'Agency Name'], axis=1, inplace=True)
df = maindf[maindf['Record ID'] < nRecords]
sdf = df[(maindf['Record ID'] < snRecords) & df['Victim Count'] > 0]

from IPython.display import display
df['Crime Solved'].replace('No', 0, inplace=True)
df['Crime Solved'].replace('Yes', 1, inplace=True)
print(pd.value_counts(df['Perpetrator Count']))
df.loc[df['Perpetrator Count'] <= 1, 'Perpetrator Count'] = 0
df.loc[df['Perpetrator Count'] > 1, 'Perpetrator Count'] = 1
multiple_caught = pd.value_counts(df['Perpetrator Count'] * df['Crime Solved'], sort=False)[1]
one_escape = pd.value_counts(df['Perpetrator Count'] | df['Crime Solved'], sort=False)[0]
one_caught = pd.value_counts(df['Perpetrator Count'] < df['Crime Solved'], sort=False)[True]
multiple_escape = pd.value_counts(df['Perpetrator Count'] > df['Crime Solved'], sort=False)[True]
res = np.matrix([[one_caught, multiple_caught], [one_escape, multiple_escape]])