GithubHelp home page GithubHelp logo

pythonhomicide's Introduction

Synopsis

This is our solutions for the python exercise about Homicide Reports US 1980-2014. The github repo contains all python files, all charts generated as images and 2 txt files.

Questions asked

  • Q1:Which ethnicity is it most common for the victims and perpetrators to be?
  • Q2:Which weapon is most used by men?
  • Q3:Which weapon is most used by women?
  • Q4:What is the age of the youngest victim and the oldest victim?
  • Q5:Average age of victims?
  • Q6:Male to female ratio of perpetrators?
  • Q7:Top 10 states with most homicides? display it with bars (barchart) or similar
  • Q8:Are younger perpetrators (age 15-25) more likely to get caught then older ones (25+)?

Solutions

1.Which ethnicity is it most common for the victims and perpetrators to be?

There is a lot of "unknowns" in both graphs, which makes it harder to make it harder to analyze.
Hispanic are more involved in crimes than non-hispanic(Both victims and perpetrators).
Less unknown ethnicity in victim's graph. Probably easier to document the ethnicity of victims than perpetrators for unsolved cases.

picture alt picture alt

2.Which weapon is most used by men?

  • First thing to note is the numbers between the two graphs. Men are more often killers than women.
  • Women tend to use "Knife" or "Blunt objects" more often than men.
  • Women use "Knife" 0.80 for every 1.0 time they use "Handgun". (1:0.8)
  • Men use "Knife" 0.30 for every 1.0 time they use "Handgun". (1:0.3)
  • Women use "Blunt Object" 0.33 for every 1.0 time they use "Handgun". (1:0.33)
  • Men use "Blunt Object" 0.23 for every 1.0 time they use "Handgun". (1:0.23) This might be because women isn't as gang-related as men and therefore doesn't have Handgun as often.
    Their murders might be more in the heat of the moment. picture alt

3.Which weapon is most used by women?

picture alt

4.What is the age of the youngest victim and the oldest victim?

We added TXT file to the project. Didn't see any reason to display with a graph.
Here is a snippet of the code getting the age of the youngest and the oldest victim and writing to a txt file.
Youngest victim was 0 years old. Oldest guy was 998 years old. Seemed like an error in the csv file or documentation. picture alt

5.Average age of victims?

We added TXT file to the project. Didn't see any reason to display with a graph.
Here is a snippet of the code getting the average age of victims and writing to a txt file.
Average age was 35.0.
picture alt

6. Male to female ratio of perpetrators?

90% male to 10% female (9:1) We used masks to remove all the "unknown", which was 70% of the perpetrators. picture alt

7. Top 10 states with most homicides? display it with bars (barchart) or similar

This graph needs to compare with population numbers of the states.
e.g. "Top 10 states with most homicides per citizen"
picture alt

Heres a list of the biggest states in US by population:

top 10 homicides state Population In Top 10 state by population Homicides per 100 Rank in population
1. California 39,250,017 393.3 1
2. Texas 27,862,596 448.7 2
3. New York 19,745,289 400.7 4
4. Florida 20,612,439 554.6 3
5.Michigan 9,928,301 348.9 10
6. Illinois 12,801,539 494.8 6
7. Pennsylvania 12,802,503 528.2 5
8. Georgia 10,310,371 488.9 8
9. North Carolina 10,146,788 497.6 9
10. Louisiana 4,681,666 238.5 25

picture alt

8. Are younger perpetrators (age 15-25) more likely to get caught then older ones (25+)?

The % of people not getting caught has so little a difference. Age doesn't affect chances of getting caught statistically.
picture alt picture alt

Authors

David Shmilowitz

Jonathan Szigethy

pythonhomicide's People

Contributors

shmilowitz avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.