Skip to content

dmorton714/lmpd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Louisville Metro Police Department Bias Study

todo

working in Cleaning and data builder

  • Build API test
  • Remove repeated code DRY
  • Build classes
    • Data builder done
    • Cleaning class needed
    • plot classes needed
  • Rework plots use plotly
    • gender plots done
  • use dash for the dashboard
  • make new requirements.txt

Code Louisville Scope

This project was created to fulfill the requirements of Code Louisville’s Python Data Analytics 2 class. The project had 4 requirements as follow.
  1. Read in two data sets.
  2. Make 3 plots
  3. Make a virtual environment for the project
  4. Annotate our code

I revisited this project recently to add API calls to everything and play with a few new plotting ideas.

The API calls are built into the data_builder.py file. You will need a API key for the Cencus data. Other than that pull which data you need and proceed to the revisited.ipynb file.

About The Data

The purpose of the project was to determine if the LMPD had a racially motivated citation record. To make the calculations I used CSV sheets from Louisville Metro Open Data site. The first sheet was the police force which has all sworn officers with age sex etc. The next data set includes all the issued citations from the police with officers and drivers data. The final portion of data I used was from the census bureau to make a data frame for Louisville base line population. From the main graph we can determine that the black population did get more citations that our populations representation. The Hispanic police officers were the only group of officers that cited black drivers less that the Louisville population. However the real surprise of the data was that Hispanic population was cited above the population average by every race of officers. Ironically the Hispanic officer population was the only group of officers to cite above the population average. Alternatively we can conclude from the data the even though the population is almost equal in terms of genders. Males are almost twice as likely to receive a citation.

Requirements

This project was made with Anaconda installed, using the below packages in VS Code using Jupyter notebooks. PIP install packages as needed. Alternatively a virtual environment is included.

Documentation for venv: (https://docs.python.org/3/tutorial/venv.html)

From the directory pip install the requirements.txt file by running "pip install -r requirements.txt"

Project Requirements:

Feature 1 Read data - Read data set from 2 csv file.
Feature 2 - Manipulate and clean your data: In each data set I cleanded the sheets by removing missing data and dropping data that was not needed. I then joined the 2 data sets into one to work from.
Feature 3 - Visualize data - Various plots were made to understand that data and a final cleaned cheet was made to compare that data.
Feature 4 - Utilized a virtual environment and include instructions in the README on how the user should run.
Feature 5 - Interpreted the data by annotating the code via markdown cells.

FIN

Virutal Environment Instructions

  1. After you have cloned the repo to your machine, navigate to the project folder in GitBash/Terminal.
  2. Create a virtual environment in the project folder.
  3. Activate the virtual environment.
  4. Install the required packages.
  5. When you are done working on your repo, deactivate the virtual environment.

Virtual Environment Commands

Command Linux/Mac GitBash
Create python3 -m venv venv python -m venv venv
Activate source venv/bin/activate source venv/Scripts/activate
Install pip install -r requirements.txt pip install -r requirements.txt
Deactivate deactivate deactivate

***final_code.ipynb no longer works as the data is now formatted differently from Louisville open data. I removed the data before realizing that. Outputs are saved for viewing.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published