Learn practical skills, build real-world projects, and advance your career

US Accidents Exploratory Analysis

The source of the data is kaggle. The dataset contains information about the accidents. The Exploratory Data Analysis can be helful to understand the reasons of the accidents and reduce the number of accidents.

1. Data Download

pip install opendatasets --upgrade --quiet
import opendatasets as od

download_url = "https://www.kaggle.com/sobhanmoosavi/us-accidents"

od.download(download_url)

data_file = './us-accidents/US_Accidents_Dec20.csv'
Please provide your Kaggle credentials to download this dataset. Learn more: http://bit.ly/kaggle-creds Your Kaggle username: sivateja Your Kaggle Key: ··········
0%| | 0.00/299M [00:00<?, ?B/s]
Downloading us-accidents.zip to ./us-accidents
100%|██████████| 299M/299M [00:08<00:00, 38.4MB/s]

2. Data preparation and cleaning

  • Load the file using pandas
  • Look at some information and columns of the data.
  • Fix any missing or incorrect values