Skip to content

Web application for crime data analysis in Los Angeles, CA (2020 - early 2024)

Notifications You must be signed in to change notification settings

angeneris/la_crime_data

Repository files navigation

Los Angeles Crime Data Analysis

You can view the live app including overall and yearly crime trends at: https://la-crime-data.onrender.com (This page uses a free subscription for deployment so it may take 50 seconds or more to load)

This repository contains code for analyzing crime data from Los Angeles, CA, spanning the years 2020 to the present. The main focus of this project is to explore and visualize various aspects of crime trends in the region.

This is a very large data set, containing almost 100k rows of data, spanning the last 4 years. The full dataframe has been uploaded to this repository using git-lfs. A sample of 50,000 was used for analysis purpose of this data.

Description: The Los Angeles Crime Data Analysis project is a Python application built using Streamlit for the web interface. It aims to provide insights into crime patterns and trends in Los Angeles County by analyzing a dataset comprising reported crimes between 2020 and the present. The analysis includes visualization of overall crime trends, top crime categories, yearly crime trends by neighborhood, and more.

The project utilizes libraries such as Pandas, Matplotlib, Seaborn, and Plotly Express for data manipulation and visualization. The Streamlit framework is used to create an interactive web application that allows users to explore the crime data and visualize trends through interactive charts and graphs.

How to Run the App:

  1. Clone the repository to your local machine.
  2. Install the required dependencies by running pip install -r requirements.txt.
  3. Run the application using Streamlit by executing streamlit run app.py in your terminal.
  4. Explore the various sections of the application to analyze different aspects of crime data, including overall trends, top crime categories, yearly trends by neighborhood, and more.

Feel free to modify the code or extend the functionality of the application to suit your specific needs or interests. The project serves as a demonstration of using Streamlit for building interactive data analysis applications.

Files

Notebooks: In addition to the app.py file, the repository also contains Jupyter notebooks (*.ipynb) that provide additional insights and analysis of the crime data. These notebooks can be found in the notebooks directory.

Dataset: The repository includes a large CSV file uploaded using Git Large File Storage (Git LFS). If you plan to replicate this project, I reccomend you use a smaller dataset or a sample of this data saved as a new csv. Otherwise, you can follow instructions online to download and use LFS.

Other Files: .gitattributes: Specifies attributes for Git repositories. .gitignore: Specifies files and directories to be ignored by Git. .streamlit: Directory containing Streamlit configuration files. requirements.txt: Text file listing the required Python packages and their versions.

Resources/ References: Crime data based in Los Angeles, CA. This data was obtained at: https://bit.ly/3JVTEhC