Code
#import CA DOJ data on arrest dispositions
This notebook looks at data from the State of California Department of Justice’s Open Justice site in an attempt to analyze the role played by race in determining the outcomes – “dispositions” – of arrests and the use of force during arrests. Below is the code used to experiment and investigate.
#import CA DOJ data on arrest dispositions
import pandas as pd
= pd.read_csv('./OnlineArrestDispoData1980-2020.csv') df
#select for arrests after the year 2010
#separate the data by the race of people arrested and the disposition code
= df[df['YEAR'] > 2010]
df 'TOTAL'] = df['F_TOTAL'] + df['M_TOTAL'] + df['S_TOTAL'] df[
import matplotlib.pyplot as plt
= df[df['RACE'] == "Black"]
df_race
= df_race[df_race['ARREST_DISP_CODE'] == "Released"]
df_release = df_race[df_race['ARREST_DISP_CODE'] == "Complaint Sought"]
df_complaint_sought = df_race[df_race['ARREST_DISP_CODE'] == "To Other Agency"]
df_to_other = df_race[df_race['ARREST_DISP_CODE'] == "Within Department"]
df_within_dept = df_race[df_race['ARREST_DISP_CODE'] == "Juvenile Probation"]
df_probation
= df_race['TOTAL'].sum()
total_arrest
= df_release['TOTAL'].sum()
total_release = df_complaint_sought['TOTAL'].sum()
total_complaint_sought = df_to_other['TOTAL'].sum()
total_to_other = df_within_dept['TOTAL'].sum()
total_within_dept = df_probation['TOTAL'].sum()
total_probation
# initialize list of lists
= [['Black',(total_release/total_arrest)*100,
data /total_arrest)*100, (total_within_dept/total_arrest)*100,
(total_to_other/total_arrest)*100, (total_complaint_sought/total_arrest)*100]]
(total_probation
= pd.DataFrame(data, columns = ['Race', 'Released', 'To Other Agency',
df_data_black 'Within Department', 'Juvenile Probation', 'Complaint Sought'])
= df[df['RACE'] == "White"]
df_race
= df_race[df_race['ARREST_DISP_CODE'] == "Released"]
df_release = df_race[df_race['ARREST_DISP_CODE'] == "Complaint Sought"]
df_complaint_sought = df_race[df_race['ARREST_DISP_CODE'] == "To Other Agency"]
df_to_other = df_race[df_race['ARREST_DISP_CODE'] == "Within Department"]
df_within_dept = df_race[df_race['ARREST_DISP_CODE'] == "Juvenile Probation"]
df_probation
= df_race['TOTAL'].sum()
total_arrest
= df_release['TOTAL'].sum()
total_release = df_complaint_sought['TOTAL'].sum()
total_complaint_sought = df_to_other['TOTAL'].sum()
total_to_other = df_within_dept['TOTAL'].sum()
total_within_dept = df_probation['TOTAL'].sum()
total_probation
# initialize list of lists
= [['White',(total_release/total_arrest)*100,
data /total_arrest)*100, (total_within_dept/total_arrest)*100,
(total_to_other/total_arrest)*100, (total_complaint_sought/total_arrest)*100]]
(total_probation
= pd.DataFrame(data, columns = ['Race', 'Released', 'To Other Agency',
df_data_white 'Within Department', 'Juvenile Probation', 'Complaint Sought'])
= df[df['RACE'] == "Hispanic"]
df_race
= df_race[df_race['ARREST_DISP_CODE'] == "Released"]
df_release = df_race[df_race['ARREST_DISP_CODE'] == "Complaint Sought"]
df_complaint_sought = df_race[df_race['ARREST_DISP_CODE'] == "To Other Agency"]
df_to_other = df_race[df_race['ARREST_DISP_CODE'] == "Within Department"]
df_within_dept = df_race[df_race['ARREST_DISP_CODE'] == "Juvenile Probation"]
df_probation
= df_race['TOTAL'].sum()
total_arrest
= df_release['TOTAL'].sum()
total_release = df_complaint_sought['TOTAL'].sum()
total_complaint_sought = df_to_other['TOTAL'].sum()
total_to_other = df_within_dept['TOTAL'].sum()
total_within_dept = df_probation['TOTAL'].sum()
total_probation
# initialize list of lists
= [['Hispanic',(total_release/total_arrest)*100,
data /total_arrest)*100, (total_within_dept/total_arrest)*100,
(total_to_other/total_arrest)*100, (total_complaint_sought/total_arrest)*100]]
(total_probation
= pd.DataFrame(data, columns = ['Race', 'Released', 'To Other Agency',
df_data_hispanic 'Within Department', 'Juvenile Probation', 'Complaint Sought'])
= df[df['RACE'] == "Other"]
df_race
= df_race[df_race['ARREST_DISP_CODE'] == "Released"]
df_release = df_race[df_race['ARREST_DISP_CODE'] == "Complaint Sought"]
df_complaint_sought = df_race[df_race['ARREST_DISP_CODE'] == "To Other Agency"]
df_to_other = df_race[df_race['ARREST_DISP_CODE'] == "Within Department"]
df_within_dept = df_race[df_race['ARREST_DISP_CODE'] == "Juvenile Probation"]
df_probation
= df_race['TOTAL'].sum()
total_arrest
= df_release['TOTAL'].sum()
total_release = df_complaint_sought['TOTAL'].sum()
total_complaint_sought = df_to_other['TOTAL'].sum()
total_to_other = df_within_dept['TOTAL'].sum()
total_within_dept = df_probation['TOTAL'].sum()
total_probation
# initialize list of lists
= [['Other',(total_release/total_arrest)*100,
data /total_arrest)*100, (total_within_dept/total_arrest)*100,
(total_to_other/total_arrest)*100, (total_complaint_sought/total_arrest)*100]]
(total_probation
= pd.DataFrame(data, columns = ['Race', 'Released', 'To Other Agency',
df_data_others 'Within Department', 'Juvenile Probation', 'Complaint Sought'])
#display the disposition data, now sorted by race & disposition
= pd.concat([df_data_black, df_data_white, df_data_hispanic, df_data_others])
df_final = df_final.set_index('Race')
df_final =True) df_final.plot.barh(stacked
<AxesSubplot:ylabel='Race'>
The majority of arrests by far result in a complaint sought, regardless of race. For the disposition of a referral to juvenile probation, Black and Hispanic individuals dominate numerically.
#import CA DOJ data on use of force during arrests
= pd.read_csv('./URSUS_Civilian-Officer_2020.csv') force_df
#break down the population of victims of force during arrests by race
= force_df[force_df['Civilian_Officer'] == "Civilian"]
officer_force_df = officer_force_df.groupby(['Race_Ethnic_Group'], as_index=True).size()
force_racial_breakdown_df force_racial_breakdown_df.plot.barh()
<AxesSubplot:ylabel='Race_Ethnic_Group'>
Hispanic individuals are clearly the victims of force during arrests at a far greater rate than individuals of any other race or ethnic group, with white people coming at second.
#break down the (assaultive) resistance of defendants during arrests by race
= force_df[force_df['Civilian_Officer'] == "Civilian"]
civilian_resistance_df = civilian_resistance_df[civilian_resistance_df['CIVILIAN_Resistance_Type'] =="assaultive"]
civilian_resistance_df = civilian_resistance_df.groupby(['Race_Ethnic_Group'], as_index=True).size()
racial_breakdown_df = True) racial_breakdown_df.plot.barh(stacked
<AxesSubplot:ylabel='Race_Ethnic_Group'>
Here, too, Hispanics outnumber every other racial and ethnic group.