Coder Social home page Coder Social logo

crime-and-crime-outcomes-west-midlands-2020's Introduction

Tutorial

For my story, I looked at the crimes that have been committed in the West Midlands between 1 January 2020 and 31 August 2020. I wanted to know how many of them have already been solved and what the outcomes were.

I downloaded the data at data.police.uk (I selected the mentioned date range and ticked "West Midlands" as force as well as the data sets "crime data" and "outcomes data").

For every month and selected data set you'll get a seperate .csv file. At first you have to put them all in two Excel-sheets: one for the crimes and one for the crime outcomes (the files have a column in which the date is stored, so you still know in which month the crime was committed/ the outcome was published). I named them "crimes-2020-west-midlands" and "outcomes-2020-west-midlands".

When you look at your data, you will see that (almost) every crime has a Crime-ID. I used VLOOKUP to match each crime with its outcome. Before I did that, I copied the "crimes-2020-west-midlands" sheet and renamed the copy to "crimes-and-outcomes-2020". In the new sheet, I added a column with the name "Outcome types" - this is where I want to see the outcome for each crime.

=VLOOKUP(A2,'outcomes-2020-west-midlands'!A:J,10,FALSE)

  • A2 = the cell in which the Crime-ID is stored - this is the value I want to look up
  • 'outcomes-2020-west-midlands'!A:J = the sheet in which the crime outcomes are stored, the range is between the Crime-ID (first column) and the outcome type (in this case last column)
  • 10 = the column in which the outcome type is stored. This is the information I want to bring back
  • FALSE = to get an exact match

After you run the function, you can see the outcome type for each crime - but in some cases it says "#N/A" instead. You can sort your data, so that they come to the top. You will see that for every crime of "Anti-social behaviour" there is no Crime-ID. Therefore, there is also no information on the outcomes of these crimes. If there is no ID, VLOOOKUP cannot match the crime with the outcome. You can rename those to something like "Anti-social behaviour: no outcome data".

Then, take a look at the remaining "#N/A"s again. The column "Last outcome category" gives information about the investigation status. There are two types left: "Status update unavailable" and "Under investigation". Rename the "#N/A"s accordingly.

You can work out which outcome type occours most often by using a pivot table and placing the field "outcome type" in both rows and value box. You could also use the COUNTIF function.

You can read the story here.

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.