{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "advanced-namibia",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: kaggle in /home/students/s444380/.local/lib/python3.7/site-packages (1.5.12)\n",
"Requirement already satisfied: pandas in /usr/lib/python3/dist-packages (0.23.3+dfsg)\n",
"Requirement already satisfied: seaborn in /usr/local/lib/python3.7/dist-packages (0.11.2)\n",
"Requirement already satisfied: python-dateutil in /usr/local/lib/python3.7/dist-packages (from kaggle) (2.8.1)\n",
"Requirement already satisfied: urllib3 in /usr/local/lib/python3.7/dist-packages (from kaggle) (1.26.3)\n",
"Requirement already satisfied: certifi in /usr/local/lib/python3.7/dist-packages (from kaggle) (2020.12.5)\n",
"Requirement already satisfied: python-slugify in /home/students/s444380/.local/lib/python3.7/site-packages (from kaggle) (6.1.1)\n",
"Requirement already satisfied: tqdm in /usr/local/lib/python3.7/dist-packages (from kaggle) (4.59.0)\n",
"Requirement already satisfied: six>=1.10 in /usr/local/lib/python3.7/dist-packages (from kaggle) (1.15.0)\n",
"Requirement already satisfied: requests in /usr/local/lib/python3.7/dist-packages (from kaggle) (2.25.1)\n",
"Requirement already satisfied: scipy>=1.0 in /usr/local/lib/python3.7/dist-packages (from seaborn) (1.7.3)\n",
"Requirement already satisfied: numpy>=1.15 in /usr/local/lib/python3.7/dist-packages (from seaborn) (1.21.5)\n",
"Requirement already satisfied: matplotlib>=2.2 in /usr/lib/python3/dist-packages (from seaborn) (3.0.2)\n",
"Requirement already satisfied: text-unidecode>=1.3 in /home/students/s444380/.local/lib/python3.7/site-packages (from python-slugify->kaggle) (1.3)\n",
"Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests->kaggle) (2.10)\n",
"Requirement already satisfied: chardet<5,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests->kaggle) (4.0.0)\n"
]
}
],
"source": [
"!pip install --user kaggle pandas seaborn"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "lasting-tomorrow",
"metadata": {},
"outputs": [],
"source": [
"# Wydziałowy jupyter z jakiegoś powodu nie rozpoznaje polecenia kaggle. Dane pobrałem ręcznie\n",
"# !kaggle datasets download -d AnalyzeBoston/crimes-in-boston"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "awful-excerpt",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Archive: archive.zip\n",
" inflating: crime.csv \n",
" inflating: offense_codes.csv \n"
]
}
],
"source": [
"!unzip -o archive.zip"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "stylish-singer",
"metadata": {},
"outputs": [],
"source": [
"!iconv -f \"windows-1252\" -t \"UTF-8\" crime.csv > crime_conv.csv"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "excessive-refrigerator",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"INCIDENT_NUMBER,OFFENSE_CODE,OFFENSE_CODE_GROUP,OFFENSE_DESCRIPTION,DISTRICT,REPORTING_AREA,SHOOTING,OCCURRED_ON_DATE,YEAR,MONTH,DAY_OF_WEEK,HOUR,UCR_PART,STREET,Lat,Long,Location\n",
"I182070945,00619,Larceny,LARCENY ALL OTHERS,D14,808,,2018-09-02 13:00:00,2018,9,Sunday,13,Part One,LINCOLN ST,42.35779134,-71.13937053,\"(42.35779134, -71.13937053)\"\n",
"I182070943,01402,Vandalism,VANDALISM,C11,347,,2018-08-21 00:00:00,2018,8,Tuesday,0,Part Two,HECLA ST,42.30682138,-71.06030035,\"(42.30682138, -71.06030035)\"\n",
"I182070941,03410,Towed,TOWED MOTOR VEHICLE,D4,151,,2018-09-03 19:27:00,2018,9,Monday,19,Part Three,CAZENOVE ST,42.34658879,-71.07242943,\"(42.34658879, -71.07242943)\"\n",
"I182070940,03114,Investigate Property,INVESTIGATE PROPERTY,D4,272,,2018-09-03 21:16:00,2018,9,Monday,21,Part Three,NEWCOMB ST,42.33418175,-71.07866441,\"(42.33418175, -71.07866441)\"\n"
]
}
],
"source": [
"!head -n 5 crime_conv.csv"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "genetic-switch",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" INCIDENT_NUMBER | \n",
" OFFENSE_CODE | \n",
" OFFENSE_CODE_GROUP | \n",
" OFFENSE_DESCRIPTION | \n",
" DISTRICT | \n",
" REPORTING_AREA | \n",
" SHOOTING | \n",
" OCCURRED_ON_DATE | \n",
" YEAR | \n",
" MONTH | \n",
" DAY_OF_WEEK | \n",
" HOUR | \n",
" UCR_PART | \n",
" STREET | \n",
" Lat | \n",
" Long | \n",
" Location | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" I182070945 | \n",
" 619 | \n",
" Larceny | \n",
" LARCENY ALL OTHERS | \n",
" D14 | \n",
" 808 | \n",
" NaN | \n",
" 2018-09-02 13:00:00 | \n",
" 2018 | \n",
" 9 | \n",
" Sunday | \n",
" 13 | \n",
" Part One | \n",
" LINCOLN ST | \n",
" 42.357791 | \n",
" -71.139371 | \n",
" (42.35779134, -71.13937053) | \n",
"
\n",
" \n",
" 1 | \n",
" I182070943 | \n",
" 1402 | \n",
" Vandalism | \n",
" VANDALISM | \n",
" C11 | \n",
" 347 | \n",
" NaN | \n",
" 2018-08-21 00:00:00 | \n",
" 2018 | \n",
" 8 | \n",
" Tuesday | \n",
" 0 | \n",
" Part Two | \n",
" HECLA ST | \n",
" 42.306821 | \n",
" -71.060300 | \n",
" (42.30682138, -71.06030035) | \n",
"
\n",
" \n",
" 2 | \n",
" I182070941 | \n",
" 3410 | \n",
" Towed | \n",
" TOWED MOTOR VEHICLE | \n",
" D4 | \n",
" 151 | \n",
" NaN | \n",
" 2018-09-03 19:27:00 | \n",
" 2018 | \n",
" 9 | \n",
" Monday | \n",
" 19 | \n",
" Part Three | \n",
" CAZENOVE ST | \n",
" 42.346589 | \n",
" -71.072429 | \n",
" (42.34658879, -71.07242943) | \n",
"
\n",
" \n",
" 3 | \n",
" I182070940 | \n",
" 3114 | \n",
" Investigate Property | \n",
" INVESTIGATE PROPERTY | \n",
" D4 | \n",
" 272 | \n",
" NaN | \n",
" 2018-09-03 21:16:00 | \n",
" 2018 | \n",
" 9 | \n",
" Monday | \n",
" 21 | \n",
" Part Three | \n",
" NEWCOMB ST | \n",
" 42.334182 | \n",
" -71.078664 | \n",
" (42.33418175, -71.07866441) | \n",
"
\n",
" \n",
" 4 | \n",
" I182070938 | \n",
" 3114 | \n",
" Investigate Property | \n",
" INVESTIGATE PROPERTY | \n",
" B3 | \n",
" 421 | \n",
" NaN | \n",
" 2018-09-03 21:05:00 | \n",
" 2018 | \n",
" 9 | \n",
" Monday | \n",
" 21 | \n",
" Part Three | \n",
" DELHI ST | \n",
" 42.275365 | \n",
" -71.090361 | \n",
" (42.27536542, -71.09036101) | \n",
"
\n",
" \n",
" 5 | \n",
" I182070936 | \n",
" 3820 | \n",
" Motor Vehicle Accident Response | \n",
" M/V ACCIDENT INVOLVING PEDESTRIAN - INJURY | \n",
" C11 | \n",
" 398 | \n",
" NaN | \n",
" 2018-09-03 21:09:00 | \n",
" 2018 | \n",
" 9 | \n",
" Monday | \n",
" 21 | \n",
" Part Three | \n",
" TALBOT AVE | \n",
" 42.290196 | \n",
" -71.071590 | \n",
" (42.29019621, -71.07159012) | \n",
"
\n",
" \n",
" 6 | \n",
" I182070933 | \n",
" 724 | \n",
" Auto Theft | \n",
" AUTO THEFT | \n",
" B2 | \n",
" 330 | \n",
" NaN | \n",
" 2018-09-03 21:25:00 | \n",
" 2018 | \n",
" 9 | \n",
" Monday | \n",
" 21 | \n",
" Part One | \n",
" NORMANDY ST | \n",
" 42.306072 | \n",
" -71.082733 | \n",
" (42.30607218, -71.08273260) | \n",
"
\n",
" \n",
" 7 | \n",
" I182070932 | \n",
" 3301 | \n",
" Verbal Disputes | \n",
" VERBAL DISPUTE | \n",
" B2 | \n",
" 584 | \n",
" NaN | \n",
" 2018-09-03 20:39:37 | \n",
" 2018 | \n",
" 9 | \n",
" Monday | \n",
" 20 | \n",
" Part Three | \n",
" LAWN ST | \n",
" 42.327016 | \n",
" -71.105551 | \n",
" (42.32701648, -71.10555088) | \n",
"
\n",
" \n",
" 8 | \n",
" I182070931 | \n",
" 301 | \n",
" Robbery | \n",
" ROBBERY - STREET | \n",
" C6 | \n",
" 177 | \n",
" NaN | \n",
" 2018-09-03 20:48:00 | \n",
" 2018 | \n",
" 9 | \n",
" Monday | \n",
" 20 | \n",
" Part One | \n",
" MASSACHUSETTS AVE | \n",
" 42.331521 | \n",
" -71.070853 | \n",
" (42.33152148, -71.07085307) | \n",
"
\n",
" \n",
" 9 | \n",
" I182070929 | \n",
" 3301 | \n",
" Verbal Disputes | \n",
" VERBAL DISPUTE | \n",
" C11 | \n",
" 364 | \n",
" NaN | \n",
" 2018-09-03 20:38:00 | \n",
" 2018 | \n",
" 9 | \n",
" Monday | \n",
" 20 | \n",
" Part Three | \n",
" LESLIE ST | \n",
" 42.295147 | \n",
" -71.058608 | \n",
" (42.29514664, -71.05860832) | \n",
"
\n",
" \n",
" 10 | \n",
" I182070928 | \n",
" 3301 | \n",
" Verbal Disputes | \n",
" VERBAL DISPUTE | \n",
" C6 | \n",
" 913 | \n",
" NaN | \n",
" 2018-09-03 19:55:00 | \n",
" 2018 | \n",
" 9 | \n",
" Monday | \n",
" 19 | \n",
" Part Three | \n",
" OCEAN VIEW DR | \n",
" 42.319579 | \n",
" -71.040328 | \n",
" (42.31957856, -71.04032766) | \n",
"
\n",
" \n",
" 11 | \n",
" I182070927 | \n",
" 3114 | \n",
" Investigate Property | \n",
" INVESTIGATE PROPERTY | \n",
" C6 | \n",
" 936 | \n",
" NaN | \n",
" 2018-09-03 20:19:00 | \n",
" 2018 | \n",
" 9 | \n",
" Monday | \n",
" 20 | \n",
" Part Three | \n",
" DALESSIO CT | \n",
" 42.340115 | \n",
" -71.053390 | \n",
" (42.34011469, -71.05339029) | \n",
"
\n",
" \n",
" 12 | \n",
" I182070923 | \n",
" 3108 | \n",
" Fire Related Reports | \n",
" FIRE REPORT - HOUSE, BUILDING, ETC. | \n",
" D4 | \n",
" 139 | \n",
" NaN | \n",
" 2018-09-03 19:58:00 | \n",
" 2018 | \n",
" 9 | \n",
" Monday | \n",
" 19 | \n",
" Part Three | \n",
" MARLBOROUGH ST | \n",
" 42.350388 | \n",
" -71.087853 | \n",
" (42.35038760, -71.08785290) | \n",
"
\n",
" \n",
" 13 | \n",
" I182070922 | \n",
" 2647 | \n",
" Other | \n",
" THREATS TO DO BODILY HARM | \n",
" B3 | \n",
" 429 | \n",
" NaN | \n",
" 2018-09-03 20:39:00 | \n",
" 2018 | \n",
" 9 | \n",
" Monday | \n",
" 20 | \n",
" Part Two | \n",
" WOODROW AVE | \n",
" 42.286470 | \n",
" -71.087147 | \n",
" (42.28647012, -71.08714661) | \n",
"
\n",
" \n",
" 14 | \n",
" I182070921 | \n",
" 3201 | \n",
" Property Lost | \n",
" PROPERTY - LOST | \n",
" B3 | \n",
" 469 | \n",
" NaN | \n",
" 2018-09-02 14:00:00 | \n",
" 2018 | \n",
" 9 | \n",
" Sunday | \n",
" 14 | \n",
" Part Three | \n",
" MULVEY ST | \n",
" 42.279241 | \n",
" -71.096674 | \n",
" (42.27924052, -71.09667382) | \n",
"
\n",
" \n",
" 15 | \n",
" I182070920 | \n",
" 3006 | \n",
" Medical Assistance | \n",
" SICK/INJURED/MEDICAL - PERSON | \n",
" NaN | \n",
" | \n",
" NaN | \n",
" 2018-09-03 19:43:00 | \n",
" 2018 | \n",
" 9 | \n",
" Monday | \n",
" 19 | \n",
" Part Three | \n",
" NaN | \n",
" 42.352875 | \n",
" -71.073830 | \n",
" (42.35287456, -71.07382970) | \n",
"
\n",
" \n",
" 16 | \n",
" I182070919 | \n",
" 3301 | \n",
" Verbal Disputes | \n",
" VERBAL DISPUTE | \n",
" C11 | \n",
" 341 | \n",
" NaN | \n",
" 2018-09-03 18:52:00 | \n",
" 2018 | \n",
" 9 | \n",
" Monday | \n",
" 18 | \n",
" Part Three | \n",
" STONEHURST ST | \n",
" 42.305264 | \n",
" -71.066838 | \n",
" (42.30526428, -71.06683755) | \n",
"
\n",
" \n",
" 17 | \n",
" I182070918 | \n",
" 3305 | \n",
" Assembly or Gathering Violations | \n",
" DEMONSTRATIONS/RIOT | \n",
" D4 | \n",
" 130 | \n",
" NaN | \n",
" 2018-09-03 17:00:00 | \n",
" 2018 | \n",
" 9 | \n",
" Monday | \n",
" 17 | \n",
" Part Three | \n",
" HUNTINGTON AVE | \n",
" 42.348577 | \n",
" -71.077720 | \n",
" (42.34857652, -71.07772012) | \n",
"
\n",
" \n",
" 18 | \n",
" I182070917 | \n",
" 2647 | \n",
" Other | \n",
" THREATS TO DO BODILY HARM | \n",
" B2 | \n",
" 901 | \n",
" NaN | \n",
" 2018-09-03 19:52:00 | \n",
" 2018 | \n",
" 9 | \n",
" Monday | \n",
" 19 | \n",
" Part Two | \n",
" HORADAN WAY | \n",
" 42.333717 | \n",
" -71.096658 | \n",
" (42.33371742, -71.09665806) | \n",
"
\n",
" \n",
" 19 | \n",
" I182070915 | \n",
" 614 | \n",
" Larceny From Motor Vehicle | \n",
" LARCENY THEFT FROM MV - NON-ACCESSORY | \n",
" B2 | \n",
" 181 | \n",
" NaN | \n",
" 2018-09-02 18:00:00 | \n",
" 2018 | \n",
" 9 | \n",
" Sunday | \n",
" 18 | \n",
" Part One | \n",
" SHIRLEY ST | \n",
" 42.325695 | \n",
" -71.068168 | \n",
" (42.32569490, -71.06816778) | \n",
"
\n",
" \n",
" 20 | \n",
" I182070913 | \n",
" 3006 | \n",
" Medical Assistance | \n",
" SICK/INJURED/MEDICAL - PERSON | \n",
" NaN | \n",
" | \n",
" NaN | \n",
" 2018-09-03 18:46:00 | \n",
" 2018 | \n",
" 9 | \n",
" Monday | \n",
" 18 | \n",
" Part Three | \n",
" WOLCOTT | \n",
" -1.000000 | \n",
" -1.000000 | \n",
" (-1.00000000, -1.00000000) | \n",
"
\n",
" \n",
" 21 | \n",
" I182070911 | \n",
" 3801 | \n",
" Motor Vehicle Accident Response | \n",
" M/V ACCIDENT - OTHER | \n",
" A1 | \n",
" 69 | \n",
" NaN | \n",
" 2018-09-03 18:30:00 | \n",
" 2018 | \n",
" 9 | \n",
" Monday | \n",
" 18 | \n",
" Part Three | \n",
" BEACON ST | \n",
" 42.355644 | \n",
" -71.071681 | \n",
" (42.35564426, -71.07168077) | \n",
"
\n",
" \n",
" 22 | \n",
" I182070910 | \n",
" 3006 | \n",
" Medical Assistance | \n",
" SICK/INJURED/MEDICAL - PERSON | \n",
" B3 | \n",
" 434 | \n",
" NaN | \n",
" 2018-09-03 18:42:00 | \n",
" 2018 | \n",
" 9 | \n",
" Monday | \n",
" 18 | \n",
" Part Three | \n",
" CAPEN ST | \n",
" 42.283402 | \n",
" -71.080797 | \n",
" (42.28340243, -71.08079740) | \n",
"
\n",
" \n",
" 23 | \n",
" I182070909 | \n",
" 3803 | \n",
" Motor Vehicle Accident Response | \n",
" M/V ACCIDENT - PERSONAL INJURY | \n",
" E5 | \n",
" 550 | \n",
" NaN | \n",
" 2018-09-03 18:33:00 | \n",
" 2018 | \n",
" 9 | \n",
" Monday | \n",
" 18 | \n",
" Part Three | \n",
" WASHINGTON ST | \n",
" 42.275818 | \n",
" -71.139913 | \n",
" (42.27581799, -71.13991259) | \n",
"
\n",
" \n",
" 24 | \n",
" I182070908 | \n",
" 522 | \n",
" Residential Burglary | \n",
" BURGLARY - RESIDENTIAL - NO FORCE | \n",
" B2 | \n",
" 911 | \n",
" NaN | \n",
" 2018-09-03 18:38:00 | \n",
" 2018 | \n",
" 9 | \n",
" Monday | \n",
" 18 | \n",
" Part One | \n",
" ANNUNCIATION RD | \n",
" 42.335062 | \n",
" -71.093168 | \n",
" (42.33506218, -71.09316781) | \n",
"
\n",
" \n",
" 25 | \n",
" I182070906 | \n",
" 3831 | \n",
" Motor Vehicle Accident Response | \n",
" M/V - LEAVING SCENE - PROPERTY DAMAGE | \n",
" NaN | \n",
" | \n",
" NaN | \n",
" 2018-09-03 18:20:00 | \n",
" 2018 | \n",
" 9 | \n",
" Monday | \n",
" 18 | \n",
" Part Three | \n",
" NaN | \n",
" 42.283593 | \n",
" -71.055657 | \n",
" (42.28359328, -71.05565683) | \n",
"
\n",
" \n",
" 26 | \n",
" I182070905 | \n",
" 3006 | \n",
" Medical Assistance | \n",
" SICK/INJURED/MEDICAL - PERSON | \n",
" D4 | \n",
" 172 | \n",
" NaN | \n",
" 2018-09-03 18:50:00 | \n",
" 2018 | \n",
" 9 | \n",
" Monday | \n",
" 18 | \n",
" Part Three | \n",
" MASSACHUSETTS AVE | \n",
" 42.333112 | \n",
" -71.072764 | \n",
" (42.33311189, -71.07276370) | \n",
"
\n",
" \n",
" 27 | \n",
" I182070904 | \n",
" 802 | \n",
" Simple Assault | \n",
" ASSAULT SIMPLE - BATTERY | \n",
" C11 | \n",
" 242 | \n",
" NaN | \n",
" 2018-09-03 18:34:00 | \n",
" 2018 | \n",
" 9 | \n",
" Monday | \n",
" 18 | \n",
" Part Two | \n",
" ANNAPOLIS ST | \n",
" 42.317319 | \n",
" -71.061509 | \n",
" (42.31731905, -71.06150882) | \n",
"
\n",
" \n",
" 28 | \n",
" I182070904 | \n",
" 2007 | \n",
" Restraining Order Violations | \n",
" VIOL. OF RESTRAINING ORDER W NO ARREST | \n",
" C11 | \n",
" 242 | \n",
" NaN | \n",
" 2018-09-03 18:34:00 | \n",
" 2018 | \n",
" 9 | \n",
" Monday | \n",
" 18 | \n",
" Part Two | \n",
" ANNAPOLIS ST | \n",
" 42.317319 | \n",
" -71.061509 | \n",
" (42.31731905, -71.06150882) | \n",
"
\n",
" \n",
" 29 | \n",
" I182070903 | \n",
" 2900 | \n",
" Other | \n",
" VAL - VIOLATION OF AUTO LAW - OTHER | \n",
" B3 | \n",
" 463 | \n",
" NaN | \n",
" 2018-09-03 18:55:00 | \n",
" 2018 | \n",
" 9 | \n",
" Monday | \n",
" 18 | \n",
" Part Two | \n",
" BLUE HILL AVE | \n",
" 42.295904 | \n",
" -71.087733 | \n",
" (42.29590385, -71.08773294) | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 319043 | \n",
" I110551302-00 | \n",
" 3125 | \n",
" Warrant Arrests | \n",
" WARRANT ARREST | \n",
" D4 | \n",
" 171 | \n",
" NaN | \n",
" 2015-07-22 22:00:00 | \n",
" 2015 | \n",
" 7 | \n",
" Wednesday | \n",
" 22 | \n",
" Part Three | \n",
" HARRISON AVE | \n",
" 42.335560 | \n",
" -71.074364 | \n",
" (42.33555954, -71.07436364) | \n",
"
\n",
" \n",
" 319044 | \n",
" I110551302-00 | \n",
" 623 | \n",
" Larceny | \n",
" LARCENY SHOPLIFTING $50 TO $199 | \n",
" D4 | \n",
" 171 | \n",
" NaN | \n",
" 2015-07-22 22:00:00 | \n",
" 2015 | \n",
" 7 | \n",
" Wednesday | \n",
" 22 | \n",
" Part One | \n",
" HARRISON AVE | \n",
" 42.335560 | \n",
" -71.074364 | \n",
" (42.33555954, -71.07436364) | \n",
"
\n",
" \n",
" 319045 | \n",
" I110372326-00 | \n",
" 403 | \n",
" Aggravated Assault | \n",
" ASSAULT & BATTERY D/W - OTHER | \n",
" A1 | \n",
" 97 | \n",
" NaN | \n",
" 2016-06-14 09:40:00 | \n",
" 2016 | \n",
" 6 | \n",
" Tuesday | \n",
" 9 | \n",
" Part One | \n",
" SCHOOL ST | \n",
" 42.357428 | \n",
" -71.058326 | \n",
" (42.35742837, -71.05832551) | \n",
"
\n",
" \n",
" 319046 | \n",
" I110372326-00 | \n",
" 3125 | \n",
" Warrant Arrests | \n",
" WARRANT ARREST | \n",
" A1 | \n",
" 97 | \n",
" NaN | \n",
" 2016-06-14 09:40:00 | \n",
" 2016 | \n",
" 6 | \n",
" Tuesday | \n",
" 9 | \n",
" Part Three | \n",
" SCHOOL ST | \n",
" 42.357428 | \n",
" -71.058326 | \n",
" (42.35742837, -71.05832551) | \n",
"
\n",
" \n",
" 319047 | \n",
" I110261417-00 | \n",
" 3125 | \n",
" Warrant Arrests | \n",
" WARRANT ARREST | \n",
" B2 | \n",
" 324 | \n",
" NaN | \n",
" 2016-07-29 00:00:00 | \n",
" 2016 | \n",
" 7 | \n",
" Friday | \n",
" 0 | \n",
" Part Three | \n",
" BOWDOIN ST | \n",
" 42.307038 | \n",
" -71.066153 | \n",
" (42.30703835, -71.06615319) | \n",
"
\n",
" \n",
" 319048 | \n",
" I110261417-00 | \n",
" 619 | \n",
" Larceny | \n",
" LARCENY OTHER $200 & OVER | \n",
" B2 | \n",
" 324 | \n",
" NaN | \n",
" 2016-07-29 00:00:00 | \n",
" 2016 | \n",
" 7 | \n",
" Friday | \n",
" 0 | \n",
" Part One | \n",
" BOWDOIN ST | \n",
" 42.307038 | \n",
" -71.066153 | \n",
" (42.30703835, -71.06615319) | \n",
"
\n",
" \n",
" 319049 | \n",
" I110177502-00 | \n",
" 3125 | \n",
" Warrant Arrests | \n",
" WARRANT ARREST | \n",
" B2 | \n",
" 318 | \n",
" NaN | \n",
" 2015-10-02 21:00:00 | \n",
" 2015 | \n",
" 10 | \n",
" Friday | \n",
" 21 | \n",
" Part Three | \n",
" HOMESTEAD ST | \n",
" 42.311277 | \n",
" -71.089093 | \n",
" (42.31127726, -71.08909334) | \n",
"
\n",
" \n",
" 319050 | \n",
" I110177502-00 | \n",
" 802 | \n",
" Simple Assault | \n",
" ASSAULT & BATTERY | \n",
" B2 | \n",
" 318 | \n",
" NaN | \n",
" 2015-10-02 21:00:00 | \n",
" 2015 | \n",
" 10 | \n",
" Friday | \n",
" 21 | \n",
" Part Two | \n",
" HOMESTEAD ST | \n",
" 42.311277 | \n",
" -71.089093 | \n",
" (42.31127726, -71.08909334) | \n",
"
\n",
" \n",
" 319051 | \n",
" I110177502-00 | \n",
" 3125 | \n",
" Warrant Arrests | \n",
" WARRANT ARREST | \n",
" B2 | \n",
" 318 | \n",
" NaN | \n",
" 2015-10-02 21:00:00 | \n",
" 2015 | \n",
" 10 | \n",
" Friday | \n",
" 21 | \n",
" Part Three | \n",
" HOMESTEAD ST | \n",
" 42.311277 | \n",
" -71.089093 | \n",
" (42.31127726, -71.08909334) | \n",
"
\n",
" \n",
" 319052 | \n",
" I100636670-00 | \n",
" 629 | \n",
" Larceny | \n",
" LARCENY OTHER $50 TO $199 | \n",
" D4 | \n",
" 285 | \n",
" NaN | \n",
" 2016-06-05 17:23:00 | \n",
" 2016 | \n",
" 6 | \n",
" Sunday | \n",
" 17 | \n",
" Part One | \n",
" COVENTRY ST | \n",
" 42.336951 | \n",
" -71.085748 | \n",
" (42.33695098, -71.08574813) | \n",
"
\n",
" \n",
" 319053 | \n",
" I100636670-00 | \n",
" 3125 | \n",
" Warrant Arrests | \n",
" WARRANT ARREST | \n",
" D4 | \n",
" 285 | \n",
" NaN | \n",
" 2016-06-05 17:23:00 | \n",
" 2016 | \n",
" 6 | \n",
" Sunday | \n",
" 17 | \n",
" Part Three | \n",
" COVENTRY ST | \n",
" 42.336951 | \n",
" -71.085748 | \n",
" (42.33695098, -71.08574813) | \n",
"
\n",
" \n",
" 319054 | \n",
" I100340225-00 | \n",
" 3125 | \n",
" Warrant Arrests | \n",
" WARRANT ARREST | \n",
" A1 | \n",
" 77 | \n",
" NaN | \n",
" 2015-07-27 10:47:00 | \n",
" 2015 | \n",
" 7 | \n",
" Monday | \n",
" 10 | \n",
" Part Three | \n",
" BOWDOIN SQ | \n",
" 42.361645 | \n",
" -71.062299 | \n",
" (42.36164502, -71.06229949) | \n",
"
\n",
" \n",
" 319055 | \n",
" I100340225-00 | \n",
" 339 | \n",
" Robbery | \n",
" ROBBERY - UNARMED - STREET | \n",
" A1 | \n",
" 77 | \n",
" NaN | \n",
" 2015-07-27 10:47:00 | \n",
" 2015 | \n",
" 7 | \n",
" Monday | \n",
" 10 | \n",
" Part One | \n",
" BOWDOIN SQ | \n",
" 42.361645 | \n",
" -71.062299 | \n",
" (42.36164502, -71.06229949) | \n",
"
\n",
" \n",
" 319056 | \n",
" I100222105-02 | \n",
" 3125 | \n",
" Warrant Arrests | \n",
" WARRANT ARREST | \n",
" E13 | \n",
" 572 | \n",
" NaN | \n",
" 2015-08-03 16:22:00 | \n",
" 2015 | \n",
" 8 | \n",
" Monday | \n",
" 16 | \n",
" Part Three | \n",
" COLUMBUS AVE | \n",
" 42.313628 | \n",
" -71.095603 | \n",
" (42.31362799, -71.09560307) | \n",
"
\n",
" \n",
" 319057 | \n",
" I100033064-00 | \n",
" 2907 | \n",
" Violations | \n",
" VAL - OPERATING AFTER REV/SUSP. | \n",
" B2 | \n",
" 304 | \n",
" NaN | \n",
" 2016-07-29 18:20:00 | \n",
" 2016 | \n",
" 7 | \n",
" Friday | \n",
" 18 | \n",
" Part Two | \n",
" SLAYTON WAY | \n",
" 42.321770 | \n",
" -71.097798 | \n",
" (42.32177032, -71.09779774) | \n",
"
\n",
" \n",
" 319058 | \n",
" I100033064-00 | \n",
" 2910 | \n",
" Violations | \n",
" VAL - OPERATING AFTER REV/SUSP. | \n",
" B2 | \n",
" 304 | \n",
" NaN | \n",
" 2016-07-29 18:20:00 | \n",
" 2016 | \n",
" 7 | \n",
" Friday | \n",
" 18 | \n",
" Part Two | \n",
" SLAYTON WAY | \n",
" 42.321770 | \n",
" -71.097798 | \n",
" (42.32177032, -71.09779774) | \n",
"
\n",
" \n",
" 319059 | \n",
" I090321958-00 | \n",
" 3125 | \n",
" Warrant Arrests | \n",
" WARRANT ARREST | \n",
" C11 | \n",
" 355 | \n",
" NaN | \n",
" 2016-02-01 01:43:00 | \n",
" 2016 | \n",
" 2 | \n",
" Monday | \n",
" 1 | \n",
" Part Three | \n",
" GENEVA AVE | \n",
" NaN | \n",
" NaN | \n",
" (0.00000000, 0.00000000) | \n",
"
\n",
" \n",
" 319060 | \n",
" I090321958-00 | \n",
" 3125 | \n",
" Warrant Arrests | \n",
" WARRANT ARREST | \n",
" C11 | \n",
" 355 | \n",
" NaN | \n",
" 2016-02-01 01:43:00 | \n",
" 2016 | \n",
" 2 | \n",
" Monday | \n",
" 1 | \n",
" Part Three | \n",
" GENEVA AVE | \n",
" NaN | \n",
" NaN | \n",
" (0.00000000, 0.00000000) | \n",
"
\n",
" \n",
" 319061 | \n",
" I090317057-00 | \n",
" 403 | \n",
" Aggravated Assault | \n",
" ASSAULT & BATTERY D/W - OTHER | \n",
" B3 | \n",
" 458 | \n",
" NaN | \n",
" 2015-11-20 11:15:00 | \n",
" 2015 | \n",
" 11 | \n",
" Friday | \n",
" 11 | \n",
" Part One | \n",
" BLUE HILL AVE | \n",
" 42.301897 | \n",
" -71.085549 | \n",
" (42.30189690, -71.08554944) | \n",
"
\n",
" \n",
" 319062 | \n",
" I090317057-00 | \n",
" 3125 | \n",
" Warrant Arrests | \n",
" WARRANT ARREST | \n",
" B3 | \n",
" 458 | \n",
" NaN | \n",
" 2015-11-20 11:15:00 | \n",
" 2015 | \n",
" 11 | \n",
" Friday | \n",
" 11 | \n",
" Part Three | \n",
" BLUE HILL AVE | \n",
" 42.301897 | \n",
" -71.085549 | \n",
" (42.30189690, -71.08554944) | \n",
"
\n",
" \n",
" 319063 | \n",
" I080542626-00 | \n",
" 3125 | \n",
" Warrant Arrests | \n",
" WARRANT ARREST | \n",
" A1 | \n",
" 111 | \n",
" NaN | \n",
" 2015-08-12 12:00:00 | \n",
" 2015 | \n",
" 8 | \n",
" Wednesday | \n",
" 12 | \n",
" Part Three | \n",
" BOYLSTON ST | \n",
" 42.352312 | \n",
" -71.063705 | \n",
" (42.35231190, -71.06370510) | \n",
"
\n",
" \n",
" 319064 | \n",
" I080542626-00 | \n",
" 1848 | \n",
" Drug Violation | \n",
" DRUGS - POSS CLASS B - INTENT TO MFR DIST DISP | \n",
" A1 | \n",
" 111 | \n",
" NaN | \n",
" 2015-08-12 12:00:00 | \n",
" 2015 | \n",
" 8 | \n",
" Wednesday | \n",
" 12 | \n",
" Part Two | \n",
" BOYLSTON ST | \n",
" 42.352312 | \n",
" -71.063705 | \n",
" (42.35231190, -71.06370510) | \n",
"
\n",
" \n",
" 319065 | \n",
" I080542626-00 | \n",
" 1849 | \n",
" Drug Violation | \n",
" DRUGS - POSS CLASS B - COCAINE, ETC. | \n",
" A1 | \n",
" 111 | \n",
" NaN | \n",
" 2015-08-12 12:00:00 | \n",
" 2015 | \n",
" 8 | \n",
" Wednesday | \n",
" 12 | \n",
" Part Two | \n",
" BOYLSTON ST | \n",
" 42.352312 | \n",
" -71.063705 | \n",
" (42.35231190, -71.06370510) | \n",
"
\n",
" \n",
" 319066 | \n",
" I060168073-00 | \n",
" 1864 | \n",
" Drug Violation | \n",
" DRUGS - POSS CLASS D - INTENT MFR DIST DISP | \n",
" E13 | \n",
" 912 | \n",
" NaN | \n",
" 2018-01-27 14:01:00 | \n",
" 2018 | \n",
" 1 | \n",
" Saturday | \n",
" 14 | \n",
" Part Two | \n",
" CENTRE ST | \n",
" 42.322838 | \n",
" -71.100967 | \n",
" (42.32283759, -71.10096723) | \n",
"
\n",
" \n",
" 319067 | \n",
" I060168073-00 | \n",
" 3125 | \n",
" Warrant Arrests | \n",
" WARRANT ARREST | \n",
" E13 | \n",
" 912 | \n",
" NaN | \n",
" 2018-01-27 14:01:00 | \n",
" 2018 | \n",
" 1 | \n",
" Saturday | \n",
" 14 | \n",
" Part Three | \n",
" CENTRE ST | \n",
" 42.322838 | \n",
" -71.100967 | \n",
" (42.32283759, -71.10096723) | \n",
"
\n",
" \n",
" 319068 | \n",
" I050310906-00 | \n",
" 3125 | \n",
" Warrant Arrests | \n",
" WARRANT ARREST | \n",
" D4 | \n",
" 285 | \n",
" NaN | \n",
" 2016-06-05 17:25:00 | \n",
" 2016 | \n",
" 6 | \n",
" Sunday | \n",
" 17 | \n",
" Part Three | \n",
" COVENTRY ST | \n",
" 42.336951 | \n",
" -71.085748 | \n",
" (42.33695098, -71.08574813) | \n",
"
\n",
" \n",
" 319069 | \n",
" I030217815-08 | \n",
" 111 | \n",
" Homicide | \n",
" MURDER, NON-NEGLIGIENT MANSLAUGHTER | \n",
" E18 | \n",
" 520 | \n",
" NaN | \n",
" 2015-07-09 13:38:00 | \n",
" 2015 | \n",
" 7 | \n",
" Thursday | \n",
" 13 | \n",
" Part One | \n",
" RIVER ST | \n",
" 42.255926 | \n",
" -71.123172 | \n",
" (42.25592648, -71.12317207) | \n",
"
\n",
" \n",
" 319070 | \n",
" I030217815-08 | \n",
" 3125 | \n",
" Warrant Arrests | \n",
" WARRANT ARREST | \n",
" E18 | \n",
" 520 | \n",
" NaN | \n",
" 2015-07-09 13:38:00 | \n",
" 2015 | \n",
" 7 | \n",
" Thursday | \n",
" 13 | \n",
" Part Three | \n",
" RIVER ST | \n",
" 42.255926 | \n",
" -71.123172 | \n",
" (42.25592648, -71.12317207) | \n",
"
\n",
" \n",
" 319071 | \n",
" I010370257-00 | \n",
" 3125 | \n",
" Warrant Arrests | \n",
" WARRANT ARREST | \n",
" E13 | \n",
" 569 | \n",
" NaN | \n",
" 2016-05-31 19:35:00 | \n",
" 2016 | \n",
" 5 | \n",
" Tuesday | \n",
" 19 | \n",
" Part Three | \n",
" NEW WASHINGTON ST | \n",
" 42.302333 | \n",
" -71.111565 | \n",
" (42.30233307, -71.11156487) | \n",
"
\n",
" \n",
" 319072 | \n",
" 142052550 | \n",
" 3125 | \n",
" Warrant Arrests | \n",
" WARRANT ARREST | \n",
" D4 | \n",
" 903 | \n",
" NaN | \n",
" 2015-06-22 00:12:00 | \n",
" 2015 | \n",
" 6 | \n",
" Monday | \n",
" 0 | \n",
" Part Three | \n",
" WASHINGTON ST | \n",
" 42.333839 | \n",
" -71.080290 | \n",
" (42.33383935, -71.08029038) | \n",
"
\n",
" \n",
"
\n",
"
319073 rows × 17 columns
\n",
"
"
],
"text/plain": [
" INCIDENT_NUMBER OFFENSE_CODE OFFENSE_CODE_GROUP \\\n",
"0 I182070945 619 Larceny \n",
"1 I182070943 1402 Vandalism \n",
"2 I182070941 3410 Towed \n",
"3 I182070940 3114 Investigate Property \n",
"4 I182070938 3114 Investigate Property \n",
"5 I182070936 3820 Motor Vehicle Accident Response \n",
"6 I182070933 724 Auto Theft \n",
"7 I182070932 3301 Verbal Disputes \n",
"8 I182070931 301 Robbery \n",
"9 I182070929 3301 Verbal Disputes \n",
"10 I182070928 3301 Verbal Disputes \n",
"11 I182070927 3114 Investigate Property \n",
"12 I182070923 3108 Fire Related Reports \n",
"13 I182070922 2647 Other \n",
"14 I182070921 3201 Property Lost \n",
"15 I182070920 3006 Medical Assistance \n",
"16 I182070919 3301 Verbal Disputes \n",
"17 I182070918 3305 Assembly or Gathering Violations \n",
"18 I182070917 2647 Other \n",
"19 I182070915 614 Larceny From Motor Vehicle \n",
"20 I182070913 3006 Medical Assistance \n",
"21 I182070911 3801 Motor Vehicle Accident Response \n",
"22 I182070910 3006 Medical Assistance \n",
"23 I182070909 3803 Motor Vehicle Accident Response \n",
"24 I182070908 522 Residential Burglary \n",
"25 I182070906 3831 Motor Vehicle Accident Response \n",
"26 I182070905 3006 Medical Assistance \n",
"27 I182070904 802 Simple Assault \n",
"28 I182070904 2007 Restraining Order Violations \n",
"29 I182070903 2900 Other \n",
"... ... ... ... \n",
"319043 I110551302-00 3125 Warrant Arrests \n",
"319044 I110551302-00 623 Larceny \n",
"319045 I110372326-00 403 Aggravated Assault \n",
"319046 I110372326-00 3125 Warrant Arrests \n",
"319047 I110261417-00 3125 Warrant Arrests \n",
"319048 I110261417-00 619 Larceny \n",
"319049 I110177502-00 3125 Warrant Arrests \n",
"319050 I110177502-00 802 Simple Assault \n",
"319051 I110177502-00 3125 Warrant Arrests \n",
"319052 I100636670-00 629 Larceny \n",
"319053 I100636670-00 3125 Warrant Arrests \n",
"319054 I100340225-00 3125 Warrant Arrests \n",
"319055 I100340225-00 339 Robbery \n",
"319056 I100222105-02 3125 Warrant Arrests \n",
"319057 I100033064-00 2907 Violations \n",
"319058 I100033064-00 2910 Violations \n",
"319059 I090321958-00 3125 Warrant Arrests \n",
"319060 I090321958-00 3125 Warrant Arrests \n",
"319061 I090317057-00 403 Aggravated Assault \n",
"319062 I090317057-00 3125 Warrant Arrests \n",
"319063 I080542626-00 3125 Warrant Arrests \n",
"319064 I080542626-00 1848 Drug Violation \n",
"319065 I080542626-00 1849 Drug Violation \n",
"319066 I060168073-00 1864 Drug Violation \n",
"319067 I060168073-00 3125 Warrant Arrests \n",
"319068 I050310906-00 3125 Warrant Arrests \n",
"319069 I030217815-08 111 Homicide \n",
"319070 I030217815-08 3125 Warrant Arrests \n",
"319071 I010370257-00 3125 Warrant Arrests \n",
"319072 142052550 3125 Warrant Arrests \n",
"\n",
" OFFENSE_DESCRIPTION DISTRICT \\\n",
"0 LARCENY ALL OTHERS D14 \n",
"1 VANDALISM C11 \n",
"2 TOWED MOTOR VEHICLE D4 \n",
"3 INVESTIGATE PROPERTY D4 \n",
"4 INVESTIGATE PROPERTY B3 \n",
"5 M/V ACCIDENT INVOLVING PEDESTRIAN - INJURY C11 \n",
"6 AUTO THEFT B2 \n",
"7 VERBAL DISPUTE B2 \n",
"8 ROBBERY - STREET C6 \n",
"9 VERBAL DISPUTE C11 \n",
"10 VERBAL DISPUTE C6 \n",
"11 INVESTIGATE PROPERTY C6 \n",
"12 FIRE REPORT - HOUSE, BUILDING, ETC. D4 \n",
"13 THREATS TO DO BODILY HARM B3 \n",
"14 PROPERTY - LOST B3 \n",
"15 SICK/INJURED/MEDICAL - PERSON NaN \n",
"16 VERBAL DISPUTE C11 \n",
"17 DEMONSTRATIONS/RIOT D4 \n",
"18 THREATS TO DO BODILY HARM B2 \n",
"19 LARCENY THEFT FROM MV - NON-ACCESSORY B2 \n",
"20 SICK/INJURED/MEDICAL - PERSON NaN \n",
"21 M/V ACCIDENT - OTHER A1 \n",
"22 SICK/INJURED/MEDICAL - PERSON B3 \n",
"23 M/V ACCIDENT - PERSONAL INJURY E5 \n",
"24 BURGLARY - RESIDENTIAL - NO FORCE B2 \n",
"25 M/V - LEAVING SCENE - PROPERTY DAMAGE NaN \n",
"26 SICK/INJURED/MEDICAL - PERSON D4 \n",
"27 ASSAULT SIMPLE - BATTERY C11 \n",
"28 VIOL. OF RESTRAINING ORDER W NO ARREST C11 \n",
"29 VAL - VIOLATION OF AUTO LAW - OTHER B3 \n",
"... ... ... \n",
"319043 WARRANT ARREST D4 \n",
"319044 LARCENY SHOPLIFTING $50 TO $199 D4 \n",
"319045 ASSAULT & BATTERY D/W - OTHER A1 \n",
"319046 WARRANT ARREST A1 \n",
"319047 WARRANT ARREST B2 \n",
"319048 LARCENY OTHER $200 & OVER B2 \n",
"319049 WARRANT ARREST B2 \n",
"319050 ASSAULT & BATTERY B2 \n",
"319051 WARRANT ARREST B2 \n",
"319052 LARCENY OTHER $50 TO $199 D4 \n",
"319053 WARRANT ARREST D4 \n",
"319054 WARRANT ARREST A1 \n",
"319055 ROBBERY - UNARMED - STREET A1 \n",
"319056 WARRANT ARREST E13 \n",
"319057 VAL - OPERATING AFTER REV/SUSP. B2 \n",
"319058 VAL - OPERATING AFTER REV/SUSP. B2 \n",
"319059 WARRANT ARREST C11 \n",
"319060 WARRANT ARREST C11 \n",
"319061 ASSAULT & BATTERY D/W - OTHER B3 \n",
"319062 WARRANT ARREST B3 \n",
"319063 WARRANT ARREST A1 \n",
"319064 DRUGS - POSS CLASS B - INTENT TO MFR DIST DISP A1 \n",
"319065 DRUGS - POSS CLASS B - COCAINE, ETC. A1 \n",
"319066 DRUGS - POSS CLASS D - INTENT MFR DIST DISP E13 \n",
"319067 WARRANT ARREST E13 \n",
"319068 WARRANT ARREST D4 \n",
"319069 MURDER, NON-NEGLIGIENT MANSLAUGHTER E18 \n",
"319070 WARRANT ARREST E18 \n",
"319071 WARRANT ARREST E13 \n",
"319072 WARRANT ARREST D4 \n",
"\n",
" REPORTING_AREA SHOOTING OCCURRED_ON_DATE YEAR MONTH DAY_OF_WEEK \\\n",
"0 808 NaN 2018-09-02 13:00:00 2018 9 Sunday \n",
"1 347 NaN 2018-08-21 00:00:00 2018 8 Tuesday \n",
"2 151 NaN 2018-09-03 19:27:00 2018 9 Monday \n",
"3 272 NaN 2018-09-03 21:16:00 2018 9 Monday \n",
"4 421 NaN 2018-09-03 21:05:00 2018 9 Monday \n",
"5 398 NaN 2018-09-03 21:09:00 2018 9 Monday \n",
"6 330 NaN 2018-09-03 21:25:00 2018 9 Monday \n",
"7 584 NaN 2018-09-03 20:39:37 2018 9 Monday \n",
"8 177 NaN 2018-09-03 20:48:00 2018 9 Monday \n",
"9 364 NaN 2018-09-03 20:38:00 2018 9 Monday \n",
"10 913 NaN 2018-09-03 19:55:00 2018 9 Monday \n",
"11 936 NaN 2018-09-03 20:19:00 2018 9 Monday \n",
"12 139 NaN 2018-09-03 19:58:00 2018 9 Monday \n",
"13 429 NaN 2018-09-03 20:39:00 2018 9 Monday \n",
"14 469 NaN 2018-09-02 14:00:00 2018 9 Sunday \n",
"15 NaN 2018-09-03 19:43:00 2018 9 Monday \n",
"16 341 NaN 2018-09-03 18:52:00 2018 9 Monday \n",
"17 130 NaN 2018-09-03 17:00:00 2018 9 Monday \n",
"18 901 NaN 2018-09-03 19:52:00 2018 9 Monday \n",
"19 181 NaN 2018-09-02 18:00:00 2018 9 Sunday \n",
"20 NaN 2018-09-03 18:46:00 2018 9 Monday \n",
"21 69 NaN 2018-09-03 18:30:00 2018 9 Monday \n",
"22 434 NaN 2018-09-03 18:42:00 2018 9 Monday \n",
"23 550 NaN 2018-09-03 18:33:00 2018 9 Monday \n",
"24 911 NaN 2018-09-03 18:38:00 2018 9 Monday \n",
"25 NaN 2018-09-03 18:20:00 2018 9 Monday \n",
"26 172 NaN 2018-09-03 18:50:00 2018 9 Monday \n",
"27 242 NaN 2018-09-03 18:34:00 2018 9 Monday \n",
"28 242 NaN 2018-09-03 18:34:00 2018 9 Monday \n",
"29 463 NaN 2018-09-03 18:55:00 2018 9 Monday \n",
"... ... ... ... ... ... ... \n",
"319043 171 NaN 2015-07-22 22:00:00 2015 7 Wednesday \n",
"319044 171 NaN 2015-07-22 22:00:00 2015 7 Wednesday \n",
"319045 97 NaN 2016-06-14 09:40:00 2016 6 Tuesday \n",
"319046 97 NaN 2016-06-14 09:40:00 2016 6 Tuesday \n",
"319047 324 NaN 2016-07-29 00:00:00 2016 7 Friday \n",
"319048 324 NaN 2016-07-29 00:00:00 2016 7 Friday \n",
"319049 318 NaN 2015-10-02 21:00:00 2015 10 Friday \n",
"319050 318 NaN 2015-10-02 21:00:00 2015 10 Friday \n",
"319051 318 NaN 2015-10-02 21:00:00 2015 10 Friday \n",
"319052 285 NaN 2016-06-05 17:23:00 2016 6 Sunday \n",
"319053 285 NaN 2016-06-05 17:23:00 2016 6 Sunday \n",
"319054 77 NaN 2015-07-27 10:47:00 2015 7 Monday \n",
"319055 77 NaN 2015-07-27 10:47:00 2015 7 Monday \n",
"319056 572 NaN 2015-08-03 16:22:00 2015 8 Monday \n",
"319057 304 NaN 2016-07-29 18:20:00 2016 7 Friday \n",
"319058 304 NaN 2016-07-29 18:20:00 2016 7 Friday \n",
"319059 355 NaN 2016-02-01 01:43:00 2016 2 Monday \n",
"319060 355 NaN 2016-02-01 01:43:00 2016 2 Monday \n",
"319061 458 NaN 2015-11-20 11:15:00 2015 11 Friday \n",
"319062 458 NaN 2015-11-20 11:15:00 2015 11 Friday \n",
"319063 111 NaN 2015-08-12 12:00:00 2015 8 Wednesday \n",
"319064 111 NaN 2015-08-12 12:00:00 2015 8 Wednesday \n",
"319065 111 NaN 2015-08-12 12:00:00 2015 8 Wednesday \n",
"319066 912 NaN 2018-01-27 14:01:00 2018 1 Saturday \n",
"319067 912 NaN 2018-01-27 14:01:00 2018 1 Saturday \n",
"319068 285 NaN 2016-06-05 17:25:00 2016 6 Sunday \n",
"319069 520 NaN 2015-07-09 13:38:00 2015 7 Thursday \n",
"319070 520 NaN 2015-07-09 13:38:00 2015 7 Thursday \n",
"319071 569 NaN 2016-05-31 19:35:00 2016 5 Tuesday \n",
"319072 903 NaN 2015-06-22 00:12:00 2015 6 Monday \n",
"\n",
" HOUR UCR_PART STREET Lat Long \\\n",
"0 13 Part One LINCOLN ST 42.357791 -71.139371 \n",
"1 0 Part Two HECLA ST 42.306821 -71.060300 \n",
"2 19 Part Three CAZENOVE ST 42.346589 -71.072429 \n",
"3 21 Part Three NEWCOMB ST 42.334182 -71.078664 \n",
"4 21 Part Three DELHI ST 42.275365 -71.090361 \n",
"5 21 Part Three TALBOT AVE 42.290196 -71.071590 \n",
"6 21 Part One NORMANDY ST 42.306072 -71.082733 \n",
"7 20 Part Three LAWN ST 42.327016 -71.105551 \n",
"8 20 Part One MASSACHUSETTS AVE 42.331521 -71.070853 \n",
"9 20 Part Three LESLIE ST 42.295147 -71.058608 \n",
"10 19 Part Three OCEAN VIEW DR 42.319579 -71.040328 \n",
"11 20 Part Three DALESSIO CT 42.340115 -71.053390 \n",
"12 19 Part Three MARLBOROUGH ST 42.350388 -71.087853 \n",
"13 20 Part Two WOODROW AVE 42.286470 -71.087147 \n",
"14 14 Part Three MULVEY ST 42.279241 -71.096674 \n",
"15 19 Part Three NaN 42.352875 -71.073830 \n",
"16 18 Part Three STONEHURST ST 42.305264 -71.066838 \n",
"17 17 Part Three HUNTINGTON AVE 42.348577 -71.077720 \n",
"18 19 Part Two HORADAN WAY 42.333717 -71.096658 \n",
"19 18 Part One SHIRLEY ST 42.325695 -71.068168 \n",
"20 18 Part Three WOLCOTT -1.000000 -1.000000 \n",
"21 18 Part Three BEACON ST 42.355644 -71.071681 \n",
"22 18 Part Three CAPEN ST 42.283402 -71.080797 \n",
"23 18 Part Three WASHINGTON ST 42.275818 -71.139913 \n",
"24 18 Part One ANNUNCIATION RD 42.335062 -71.093168 \n",
"25 18 Part Three NaN 42.283593 -71.055657 \n",
"26 18 Part Three MASSACHUSETTS AVE 42.333112 -71.072764 \n",
"27 18 Part Two ANNAPOLIS ST 42.317319 -71.061509 \n",
"28 18 Part Two ANNAPOLIS ST 42.317319 -71.061509 \n",
"29 18 Part Two BLUE HILL AVE 42.295904 -71.087733 \n",
"... ... ... ... ... ... \n",
"319043 22 Part Three HARRISON AVE 42.335560 -71.074364 \n",
"319044 22 Part One HARRISON AVE 42.335560 -71.074364 \n",
"319045 9 Part One SCHOOL ST 42.357428 -71.058326 \n",
"319046 9 Part Three SCHOOL ST 42.357428 -71.058326 \n",
"319047 0 Part Three BOWDOIN ST 42.307038 -71.066153 \n",
"319048 0 Part One BOWDOIN ST 42.307038 -71.066153 \n",
"319049 21 Part Three HOMESTEAD ST 42.311277 -71.089093 \n",
"319050 21 Part Two HOMESTEAD ST 42.311277 -71.089093 \n",
"319051 21 Part Three HOMESTEAD ST 42.311277 -71.089093 \n",
"319052 17 Part One COVENTRY ST 42.336951 -71.085748 \n",
"319053 17 Part Three COVENTRY ST 42.336951 -71.085748 \n",
"319054 10 Part Three BOWDOIN SQ 42.361645 -71.062299 \n",
"319055 10 Part One BOWDOIN SQ 42.361645 -71.062299 \n",
"319056 16 Part Three COLUMBUS AVE 42.313628 -71.095603 \n",
"319057 18 Part Two SLAYTON WAY 42.321770 -71.097798 \n",
"319058 18 Part Two SLAYTON WAY 42.321770 -71.097798 \n",
"319059 1 Part Three GENEVA AVE NaN NaN \n",
"319060 1 Part Three GENEVA AVE NaN NaN \n",
"319061 11 Part One BLUE HILL AVE 42.301897 -71.085549 \n",
"319062 11 Part Three BLUE HILL AVE 42.301897 -71.085549 \n",
"319063 12 Part Three BOYLSTON ST 42.352312 -71.063705 \n",
"319064 12 Part Two BOYLSTON ST 42.352312 -71.063705 \n",
"319065 12 Part Two BOYLSTON ST 42.352312 -71.063705 \n",
"319066 14 Part Two CENTRE ST 42.322838 -71.100967 \n",
"319067 14 Part Three CENTRE ST 42.322838 -71.100967 \n",
"319068 17 Part Three COVENTRY ST 42.336951 -71.085748 \n",
"319069 13 Part One RIVER ST 42.255926 -71.123172 \n",
"319070 13 Part Three RIVER ST 42.255926 -71.123172 \n",
"319071 19 Part Three NEW WASHINGTON ST 42.302333 -71.111565 \n",
"319072 0 Part Three WASHINGTON ST 42.333839 -71.080290 \n",
"\n",
" Location \n",
"0 (42.35779134, -71.13937053) \n",
"1 (42.30682138, -71.06030035) \n",
"2 (42.34658879, -71.07242943) \n",
"3 (42.33418175, -71.07866441) \n",
"4 (42.27536542, -71.09036101) \n",
"5 (42.29019621, -71.07159012) \n",
"6 (42.30607218, -71.08273260) \n",
"7 (42.32701648, -71.10555088) \n",
"8 (42.33152148, -71.07085307) \n",
"9 (42.29514664, -71.05860832) \n",
"10 (42.31957856, -71.04032766) \n",
"11 (42.34011469, -71.05339029) \n",
"12 (42.35038760, -71.08785290) \n",
"13 (42.28647012, -71.08714661) \n",
"14 (42.27924052, -71.09667382) \n",
"15 (42.35287456, -71.07382970) \n",
"16 (42.30526428, -71.06683755) \n",
"17 (42.34857652, -71.07772012) \n",
"18 (42.33371742, -71.09665806) \n",
"19 (42.32569490, -71.06816778) \n",
"20 (-1.00000000, -1.00000000) \n",
"21 (42.35564426, -71.07168077) \n",
"22 (42.28340243, -71.08079740) \n",
"23 (42.27581799, -71.13991259) \n",
"24 (42.33506218, -71.09316781) \n",
"25 (42.28359328, -71.05565683) \n",
"26 (42.33311189, -71.07276370) \n",
"27 (42.31731905, -71.06150882) \n",
"28 (42.31731905, -71.06150882) \n",
"29 (42.29590385, -71.08773294) \n",
"... ... \n",
"319043 (42.33555954, -71.07436364) \n",
"319044 (42.33555954, -71.07436364) \n",
"319045 (42.35742837, -71.05832551) \n",
"319046 (42.35742837, -71.05832551) \n",
"319047 (42.30703835, -71.06615319) \n",
"319048 (42.30703835, -71.06615319) \n",
"319049 (42.31127726, -71.08909334) \n",
"319050 (42.31127726, -71.08909334) \n",
"319051 (42.31127726, -71.08909334) \n",
"319052 (42.33695098, -71.08574813) \n",
"319053 (42.33695098, -71.08574813) \n",
"319054 (42.36164502, -71.06229949) \n",
"319055 (42.36164502, -71.06229949) \n",
"319056 (42.31362799, -71.09560307) \n",
"319057 (42.32177032, -71.09779774) \n",
"319058 (42.32177032, -71.09779774) \n",
"319059 (0.00000000, 0.00000000) \n",
"319060 (0.00000000, 0.00000000) \n",
"319061 (42.30189690, -71.08554944) \n",
"319062 (42.30189690, -71.08554944) \n",
"319063 (42.35231190, -71.06370510) \n",
"319064 (42.35231190, -71.06370510) \n",
"319065 (42.35231190, -71.06370510) \n",
"319066 (42.32283759, -71.10096723) \n",
"319067 (42.32283759, -71.10096723) \n",
"319068 (42.33695098, -71.08574813) \n",
"319069 (42.25592648, -71.12317207) \n",
"319070 (42.25592648, -71.12317207) \n",
"319071 (42.30233307, -71.11156487) \n",
"319072 (42.33383935, -71.08029038) \n",
"\n",
"[319073 rows x 17 columns]"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import pandas as pd\n",
"crime = pd.read_csv('crime_conv.csv')\n",
"crime"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "instant-monitor",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" INCIDENT_NUMBER | \n",
" OFFENSE_CODE | \n",
" OFFENSE_CODE_GROUP | \n",
" OFFENSE_DESCRIPTION | \n",
" DISTRICT | \n",
" REPORTING_AREA | \n",
" SHOOTING | \n",
" OCCURRED_ON_DATE | \n",
" YEAR | \n",
" MONTH | \n",
" DAY_OF_WEEK | \n",
" HOUR | \n",
" UCR_PART | \n",
" STREET | \n",
" Lat | \n",
" Long | \n",
" Location | \n",
"
\n",
" \n",
" \n",
" \n",
" count | \n",
" 319073 | \n",
" 319073.000000 | \n",
" 319073 | \n",
" 319073 | \n",
" 317308 | \n",
" 319073 | \n",
" 1019 | \n",
" 319073 | \n",
" 319073.000000 | \n",
" 319073.000000 | \n",
" 319073 | \n",
" 319073.000000 | \n",
" 318983 | \n",
" 308202 | \n",
" 299074.000000 | \n",
" 299074.000000 | \n",
" 319073 | \n",
"
\n",
" \n",
" unique | \n",
" 282517 | \n",
" NaN | \n",
" 67 | \n",
" 244 | \n",
" 12 | \n",
" 879 | \n",
" 1 | \n",
" 233229 | \n",
" NaN | \n",
" NaN | \n",
" 7 | \n",
" NaN | \n",
" 4 | \n",
" 4657 | \n",
" NaN | \n",
" NaN | \n",
" 18194 | \n",
"
\n",
" \n",
" top | \n",
" I162030584 | \n",
" NaN | \n",
" Motor Vehicle Accident Response | \n",
" SICK/INJURED/MEDICAL - PERSON | \n",
" B2 | \n",
" | \n",
" Y | \n",
" 2017-06-01 00:00:00 | \n",
" NaN | \n",
" NaN | \n",
" Friday | \n",
" NaN | \n",
" Part Three | \n",
" WASHINGTON ST | \n",
" NaN | \n",
" NaN | \n",
" (0.00000000, 0.00000000) | \n",
"
\n",
" \n",
" freq | \n",
" 13 | \n",
" NaN | \n",
" 37132 | \n",
" 18783 | \n",
" 49945 | \n",
" 20250 | \n",
" 1019 | \n",
" 29 | \n",
" NaN | \n",
" NaN | \n",
" 48495 | \n",
" NaN | \n",
" 158553 | \n",
" 14194 | \n",
" NaN | \n",
" NaN | \n",
" 19999 | \n",
"
\n",
" \n",
" mean | \n",
" NaN | \n",
" 2317.546956 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 2016.560586 | \n",
" 6.609719 | \n",
" NaN | \n",
" 13.118205 | \n",
" NaN | \n",
" NaN | \n",
" 42.214381 | \n",
" -70.908272 | \n",
" NaN | \n",
"
\n",
" \n",
" std | \n",
" NaN | \n",
" 1185.285543 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 0.996344 | \n",
" 3.273691 | \n",
" NaN | \n",
" 6.294205 | \n",
" NaN | \n",
" NaN | \n",
" 2.159766 | \n",
" 3.493618 | \n",
" NaN | \n",
"
\n",
" \n",
" min | \n",
" NaN | \n",
" 111.000000 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 2015.000000 | \n",
" 1.000000 | \n",
" NaN | \n",
" 0.000000 | \n",
" NaN | \n",
" NaN | \n",
" -1.000000 | \n",
" -71.178674 | \n",
" NaN | \n",
"
\n",
" \n",
" 25% | \n",
" NaN | \n",
" 1001.000000 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 2016.000000 | \n",
" 4.000000 | \n",
" NaN | \n",
" 9.000000 | \n",
" NaN | \n",
" NaN | \n",
" 42.297442 | \n",
" -71.097135 | \n",
" NaN | \n",
"
\n",
" \n",
" 50% | \n",
" NaN | \n",
" 2907.000000 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 2017.000000 | \n",
" 7.000000 | \n",
" NaN | \n",
" 14.000000 | \n",
" NaN | \n",
" NaN | \n",
" 42.325538 | \n",
" -71.077524 | \n",
" NaN | \n",
"
\n",
" \n",
" 75% | \n",
" NaN | \n",
" 3201.000000 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 2017.000000 | \n",
" 9.000000 | \n",
" NaN | \n",
" 18.000000 | \n",
" NaN | \n",
" NaN | \n",
" 42.348624 | \n",
" -71.062467 | \n",
" NaN | \n",
"
\n",
" \n",
" max | \n",
" NaN | \n",
" 3831.000000 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 2018.000000 | \n",
" 12.000000 | \n",
" NaN | \n",
" 23.000000 | \n",
" NaN | \n",
" NaN | \n",
" 42.395042 | \n",
" -1.000000 | \n",
" NaN | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" INCIDENT_NUMBER OFFENSE_CODE OFFENSE_CODE_GROUP \\\n",
"count 319073 319073.000000 319073 \n",
"unique 282517 NaN 67 \n",
"top I162030584 NaN Motor Vehicle Accident Response \n",
"freq 13 NaN 37132 \n",
"mean NaN 2317.546956 NaN \n",
"std NaN 1185.285543 NaN \n",
"min NaN 111.000000 NaN \n",
"25% NaN 1001.000000 NaN \n",
"50% NaN 2907.000000 NaN \n",
"75% NaN 3201.000000 NaN \n",
"max NaN 3831.000000 NaN \n",
"\n",
" OFFENSE_DESCRIPTION DISTRICT REPORTING_AREA SHOOTING \\\n",
"count 319073 317308 319073 1019 \n",
"unique 244 12 879 1 \n",
"top SICK/INJURED/MEDICAL - PERSON B2 Y \n",
"freq 18783 49945 20250 1019 \n",
"mean NaN NaN NaN NaN \n",
"std NaN NaN NaN NaN \n",
"min NaN NaN NaN NaN \n",
"25% NaN NaN NaN NaN \n",
"50% NaN NaN NaN NaN \n",
"75% NaN NaN NaN NaN \n",
"max NaN NaN NaN NaN \n",
"\n",
" OCCURRED_ON_DATE YEAR MONTH DAY_OF_WEEK \\\n",
"count 319073 319073.000000 319073.000000 319073 \n",
"unique 233229 NaN NaN 7 \n",
"top 2017-06-01 00:00:00 NaN NaN Friday \n",
"freq 29 NaN NaN 48495 \n",
"mean NaN 2016.560586 6.609719 NaN \n",
"std NaN 0.996344 3.273691 NaN \n",
"min NaN 2015.000000 1.000000 NaN \n",
"25% NaN 2016.000000 4.000000 NaN \n",
"50% NaN 2017.000000 7.000000 NaN \n",
"75% NaN 2017.000000 9.000000 NaN \n",
"max NaN 2018.000000 12.000000 NaN \n",
"\n",
" HOUR UCR_PART STREET Lat \\\n",
"count 319073.000000 318983 308202 299074.000000 \n",
"unique NaN 4 4657 NaN \n",
"top NaN Part Three WASHINGTON ST NaN \n",
"freq NaN 158553 14194 NaN \n",
"mean 13.118205 NaN NaN 42.214381 \n",
"std 6.294205 NaN NaN 2.159766 \n",
"min 0.000000 NaN NaN -1.000000 \n",
"25% 9.000000 NaN NaN 42.297442 \n",
"50% 14.000000 NaN NaN 42.325538 \n",
"75% 18.000000 NaN NaN 42.348624 \n",
"max 23.000000 NaN NaN 42.395042 \n",
"\n",
" Long Location \n",
"count 299074.000000 319073 \n",
"unique NaN 18194 \n",
"top NaN (0.00000000, 0.00000000) \n",
"freq NaN 19999 \n",
"mean -70.908272 NaN \n",
"std 3.493618 NaN \n",
"min -71.178674 NaN \n",
"25% -71.097135 NaN \n",
"50% -71.077524 NaN \n",
"75% -71.062467 NaN \n",
"max -1.000000 NaN "
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"crime.describe(include=\"all\")"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "still-sweet",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" INCIDENT_NUMBER | \n",
" OFFENSE_CODE | \n",
" OFFENSE_CODE_GROUP | \n",
" OFFENSE_DESCRIPTION | \n",
" DISTRICT | \n",
" REPORTING_AREA | \n",
" SHOOTING | \n",
" OCCURRED_ON_DATE | \n",
" YEAR | \n",
" MONTH | \n",
" DAY_OF_WEEK | \n",
" HOUR | \n",
" UCR_PART | \n",
" STREET | \n",
" Lat | \n",
" Long | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" I182070945 | \n",
" 619 | \n",
" larceny | \n",
" larceny all others | \n",
" D14 | \n",
" 808 | \n",
" N | \n",
" 2018-09-02 13:00:00 | \n",
" 2018 | \n",
" 9 | \n",
" sunday | \n",
" 13 | \n",
" part one | \n",
" lincoln st | \n",
" 42.357791 | \n",
" -71.139371 | \n",
"
\n",
" \n",
" 1 | \n",
" I182070943 | \n",
" 1402 | \n",
" vandalism | \n",
" vandalism | \n",
" C11 | \n",
" 347 | \n",
" N | \n",
" 2018-08-21 00:00:00 | \n",
" 2018 | \n",
" 8 | \n",
" tuesday | \n",
" 0 | \n",
" part two | \n",
" hecla st | \n",
" 42.306821 | \n",
" -71.060300 | \n",
"
\n",
" \n",
" 2 | \n",
" I182070941 | \n",
" 3410 | \n",
" towed | \n",
" towed motor vehicle | \n",
" D4 | \n",
" 151 | \n",
" N | \n",
" 2018-09-03 19:27:00 | \n",
" 2018 | \n",
" 9 | \n",
" monday | \n",
" 19 | \n",
" part three | \n",
" cazenove st | \n",
" 42.346589 | \n",
" -71.072429 | \n",
"
\n",
" \n",
" 3 | \n",
" I182070940 | \n",
" 3114 | \n",
" investigate property | \n",
" investigate property | \n",
" D4 | \n",
" 272 | \n",
" N | \n",
" 2018-09-03 21:16:00 | \n",
" 2018 | \n",
" 9 | \n",
" monday | \n",
" 21 | \n",
" part three | \n",
" newcomb st | \n",
" 42.334182 | \n",
" -71.078664 | \n",
"
\n",
" \n",
" 4 | \n",
" I182070938 | \n",
" 3114 | \n",
" investigate property | \n",
" investigate property | \n",
" B3 | \n",
" 421 | \n",
" N | \n",
" 2018-09-03 21:05:00 | \n",
" 2018 | \n",
" 9 | \n",
" monday | \n",
" 21 | \n",
" part three | \n",
" delhi st | \n",
" 42.275365 | \n",
" -71.090361 | \n",
"
\n",
" \n",
" 5 | \n",
" I182070936 | \n",
" 3820 | \n",
" motor vehicle accident response | \n",
" m/v accident involving pedestrian - injury | \n",
" C11 | \n",
" 398 | \n",
" N | \n",
" 2018-09-03 21:09:00 | \n",
" 2018 | \n",
" 9 | \n",
" monday | \n",
" 21 | \n",
" part three | \n",
" talbot ave | \n",
" 42.290196 | \n",
" -71.071590 | \n",
"
\n",
" \n",
" 6 | \n",
" I182070933 | \n",
" 724 | \n",
" auto theft | \n",
" auto theft | \n",
" B2 | \n",
" 330 | \n",
" N | \n",
" 2018-09-03 21:25:00 | \n",
" 2018 | \n",
" 9 | \n",
" monday | \n",
" 21 | \n",
" part one | \n",
" normandy st | \n",
" 42.306072 | \n",
" -71.082733 | \n",
"
\n",
" \n",
" 7 | \n",
" I182070932 | \n",
" 3301 | \n",
" verbal disputes | \n",
" verbal dispute | \n",
" B2 | \n",
" 584 | \n",
" N | \n",
" 2018-09-03 20:39:37 | \n",
" 2018 | \n",
" 9 | \n",
" monday | \n",
" 20 | \n",
" part three | \n",
" lawn st | \n",
" 42.327016 | \n",
" -71.105551 | \n",
"
\n",
" \n",
" 8 | \n",
" I182070931 | \n",
" 301 | \n",
" robbery | \n",
" robbery - street | \n",
" C6 | \n",
" 177 | \n",
" N | \n",
" 2018-09-03 20:48:00 | \n",
" 2018 | \n",
" 9 | \n",
" monday | \n",
" 20 | \n",
" part one | \n",
" massachusetts ave | \n",
" 42.331521 | \n",
" -71.070853 | \n",
"
\n",
" \n",
" 9 | \n",
" I182070929 | \n",
" 3301 | \n",
" verbal disputes | \n",
" verbal dispute | \n",
" C11 | \n",
" 364 | \n",
" N | \n",
" 2018-09-03 20:38:00 | \n",
" 2018 | \n",
" 9 | \n",
" monday | \n",
" 20 | \n",
" part three | \n",
" leslie st | \n",
" 42.295147 | \n",
" -71.058608 | \n",
"
\n",
" \n",
" 10 | \n",
" I182070928 | \n",
" 3301 | \n",
" verbal disputes | \n",
" verbal dispute | \n",
" C6 | \n",
" 913 | \n",
" N | \n",
" 2018-09-03 19:55:00 | \n",
" 2018 | \n",
" 9 | \n",
" monday | \n",
" 19 | \n",
" part three | \n",
" ocean view dr | \n",
" 42.319579 | \n",
" -71.040328 | \n",
"
\n",
" \n",
" 11 | \n",
" I182070927 | \n",
" 3114 | \n",
" investigate property | \n",
" investigate property | \n",
" C6 | \n",
" 936 | \n",
" N | \n",
" 2018-09-03 20:19:00 | \n",
" 2018 | \n",
" 9 | \n",
" monday | \n",
" 20 | \n",
" part three | \n",
" dalessio ct | \n",
" 42.340115 | \n",
" -71.053390 | \n",
"
\n",
" \n",
" 12 | \n",
" I182070923 | \n",
" 3108 | \n",
" fire related reports | \n",
" fire report - house, building, etc. | \n",
" D4 | \n",
" 139 | \n",
" N | \n",
" 2018-09-03 19:58:00 | \n",
" 2018 | \n",
" 9 | \n",
" monday | \n",
" 19 | \n",
" part three | \n",
" marlborough st | \n",
" 42.350388 | \n",
" -71.087853 | \n",
"
\n",
" \n",
" 13 | \n",
" I182070922 | \n",
" 2647 | \n",
" other | \n",
" threats to do bodily harm | \n",
" B3 | \n",
" 429 | \n",
" N | \n",
" 2018-09-03 20:39:00 | \n",
" 2018 | \n",
" 9 | \n",
" monday | \n",
" 20 | \n",
" part two | \n",
" woodrow ave | \n",
" 42.286470 | \n",
" -71.087147 | \n",
"
\n",
" \n",
" 14 | \n",
" I182070921 | \n",
" 3201 | \n",
" property lost | \n",
" property - lost | \n",
" B3 | \n",
" 469 | \n",
" N | \n",
" 2018-09-02 14:00:00 | \n",
" 2018 | \n",
" 9 | \n",
" sunday | \n",
" 14 | \n",
" part three | \n",
" mulvey st | \n",
" 42.279241 | \n",
" -71.096674 | \n",
"
\n",
" \n",
" 16 | \n",
" I182070919 | \n",
" 3301 | \n",
" verbal disputes | \n",
" verbal dispute | \n",
" C11 | \n",
" 341 | \n",
" N | \n",
" 2018-09-03 18:52:00 | \n",
" 2018 | \n",
" 9 | \n",
" monday | \n",
" 18 | \n",
" part three | \n",
" stonehurst st | \n",
" 42.305264 | \n",
" -71.066838 | \n",
"
\n",
" \n",
" 17 | \n",
" I182070918 | \n",
" 3305 | \n",
" assembly or gathering violations | \n",
" demonstrations/riot | \n",
" D4 | \n",
" 130 | \n",
" N | \n",
" 2018-09-03 17:00:00 | \n",
" 2018 | \n",
" 9 | \n",
" monday | \n",
" 17 | \n",
" part three | \n",
" huntington ave | \n",
" 42.348577 | \n",
" -71.077720 | \n",
"
\n",
" \n",
" 18 | \n",
" I182070917 | \n",
" 2647 | \n",
" other | \n",
" threats to do bodily harm | \n",
" B2 | \n",
" 901 | \n",
" N | \n",
" 2018-09-03 19:52:00 | \n",
" 2018 | \n",
" 9 | \n",
" monday | \n",
" 19 | \n",
" part two | \n",
" horadan way | \n",
" 42.333717 | \n",
" -71.096658 | \n",
"
\n",
" \n",
" 19 | \n",
" I182070915 | \n",
" 614 | \n",
" larceny from motor vehicle | \n",
" larceny theft from mv - non-accessory | \n",
" B2 | \n",
" 181 | \n",
" N | \n",
" 2018-09-02 18:00:00 | \n",
" 2018 | \n",
" 9 | \n",
" sunday | \n",
" 18 | \n",
" part one | \n",
" shirley st | \n",
" 42.325695 | \n",
" -71.068168 | \n",
"
\n",
" \n",
" 21 | \n",
" I182070911 | \n",
" 3801 | \n",
" motor vehicle accident response | \n",
" m/v accident - other | \n",
" A1 | \n",
" 69 | \n",
" N | \n",
" 2018-09-03 18:30:00 | \n",
" 2018 | \n",
" 9 | \n",
" monday | \n",
" 18 | \n",
" part three | \n",
" beacon st | \n",
" 42.355644 | \n",
" -71.071681 | \n",
"
\n",
" \n",
" 22 | \n",
" I182070910 | \n",
" 3006 | \n",
" medical assistance | \n",
" sick/injured/medical - person | \n",
" B3 | \n",
" 434 | \n",
" N | \n",
" 2018-09-03 18:42:00 | \n",
" 2018 | \n",
" 9 | \n",
" monday | \n",
" 18 | \n",
" part three | \n",
" capen st | \n",
" 42.283402 | \n",
" -71.080797 | \n",
"
\n",
" \n",
" 23 | \n",
" I182070909 | \n",
" 3803 | \n",
" motor vehicle accident response | \n",
" m/v accident - personal injury | \n",
" E5 | \n",
" 550 | \n",
" N | \n",
" 2018-09-03 18:33:00 | \n",
" 2018 | \n",
" 9 | \n",
" monday | \n",
" 18 | \n",
" part three | \n",
" washington st | \n",
" 42.275818 | \n",
" -71.139913 | \n",
"
\n",
" \n",
" 24 | \n",
" I182070908 | \n",
" 522 | \n",
" residential burglary | \n",
" burglary - residential - no force | \n",
" B2 | \n",
" 911 | \n",
" N | \n",
" 2018-09-03 18:38:00 | \n",
" 2018 | \n",
" 9 | \n",
" monday | \n",
" 18 | \n",
" part one | \n",
" annunciation rd | \n",
" 42.335062 | \n",
" -71.093168 | \n",
"
\n",
" \n",
" 26 | \n",
" I182070905 | \n",
" 3006 | \n",
" medical assistance | \n",
" sick/injured/medical - person | \n",
" D4 | \n",
" 172 | \n",
" N | \n",
" 2018-09-03 18:50:00 | \n",
" 2018 | \n",
" 9 | \n",
" monday | \n",
" 18 | \n",
" part three | \n",
" massachusetts ave | \n",
" 42.333112 | \n",
" -71.072764 | \n",
"
\n",
" \n",
" 27 | \n",
" I182070904 | \n",
" 802 | \n",
" simple assault | \n",
" assault simple - battery | \n",
" C11 | \n",
" 242 | \n",
" N | \n",
" 2018-09-03 18:34:00 | \n",
" 2018 | \n",
" 9 | \n",
" monday | \n",
" 18 | \n",
" part two | \n",
" annapolis st | \n",
" 42.317319 | \n",
" -71.061509 | \n",
"
\n",
" \n",
" 28 | \n",
" I182070904 | \n",
" 2007 | \n",
" restraining order violations | \n",
" viol. of restraining order w no arrest | \n",
" C11 | \n",
" 242 | \n",
" N | \n",
" 2018-09-03 18:34:00 | \n",
" 2018 | \n",
" 9 | \n",
" monday | \n",
" 18 | \n",
" part two | \n",
" annapolis st | \n",
" 42.317319 | \n",
" -71.061509 | \n",
"
\n",
" \n",
" 29 | \n",
" I182070903 | \n",
" 2900 | \n",
" other | \n",
" val - violation of auto law - other | \n",
" B3 | \n",
" 463 | \n",
" N | \n",
" 2018-09-03 18:55:00 | \n",
" 2018 | \n",
" 9 | \n",
" monday | \n",
" 18 | \n",
" part two | \n",
" blue hill ave | \n",
" 42.295904 | \n",
" -71.087733 | \n",
"
\n",
" \n",
" 30 | \n",
" I182070901 | \n",
" 2907 | \n",
" violations | \n",
" val - operating after rev/susp. | \n",
" B3 | \n",
" 428 | \n",
" N | \n",
" 2018-09-03 18:41:00 | \n",
" 2018 | \n",
" 9 | \n",
" monday | \n",
" 18 | \n",
" part two | \n",
" clarkwood st | \n",
" 42.280137 | \n",
" -71.090798 | \n",
"
\n",
" \n",
" 31 | \n",
" I182070900 | \n",
" 2629 | \n",
" harassment | \n",
" harassment | \n",
" B3 | \n",
" 464 | \n",
" N | \n",
" 2018-09-03 18:17:00 | \n",
" 2018 | \n",
" 9 | \n",
" monday | \n",
" 18 | \n",
" part two | \n",
" hansborough st | \n",
" 42.288104 | \n",
" -71.091533 | \n",
"
\n",
" \n",
" 32 | \n",
" I182070898 | \n",
" 802 | \n",
" simple assault | \n",
" assault simple - battery | \n",
" C11 | \n",
" 351 | \n",
" N | \n",
" 2018-09-03 19:11:00 | \n",
" 2018 | \n",
" 9 | \n",
" monday | \n",
" 19 | \n",
" part two | \n",
" salisbury park | \n",
" 42.299284 | \n",
" -71.059172 | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 319040 | \n",
" I110694557-00 | \n",
" 3125 | \n",
" warrant arrests | \n",
" warrant arrest | \n",
" B3 | \n",
" 436 | \n",
" N | \n",
" 2016-01-22 09:45:00 | \n",
" 2016 | \n",
" 1 | \n",
" friday | \n",
" 9 | \n",
" part three | \n",
" withington st | \n",
" 42.288767 | \n",
" -71.072897 | \n",
"
\n",
" \n",
" 319041 | \n",
" I110694557-00 | \n",
" 3115 | \n",
" investigate person | \n",
" investigate person | \n",
" B3 | \n",
" 436 | \n",
" N | \n",
" 2016-01-22 09:45:00 | \n",
" 2016 | \n",
" 1 | \n",
" friday | \n",
" 9 | \n",
" part three | \n",
" withington st | \n",
" 42.288767 | \n",
" -71.072897 | \n",
"
\n",
" \n",
" 319043 | \n",
" I110551302-00 | \n",
" 3125 | \n",
" warrant arrests | \n",
" warrant arrest | \n",
" D4 | \n",
" 171 | \n",
" N | \n",
" 2015-07-22 22:00:00 | \n",
" 2015 | \n",
" 7 | \n",
" wednesday | \n",
" 22 | \n",
" part three | \n",
" harrison ave | \n",
" 42.335560 | \n",
" -71.074364 | \n",
"
\n",
" \n",
" 319044 | \n",
" I110551302-00 | \n",
" 623 | \n",
" larceny | \n",
" larceny shoplifting $50 to $199 | \n",
" D4 | \n",
" 171 | \n",
" N | \n",
" 2015-07-22 22:00:00 | \n",
" 2015 | \n",
" 7 | \n",
" wednesday | \n",
" 22 | \n",
" part one | \n",
" harrison ave | \n",
" 42.335560 | \n",
" -71.074364 | \n",
"
\n",
" \n",
" 319045 | \n",
" I110372326-00 | \n",
" 403 | \n",
" aggravated assault | \n",
" assault & battery d/w - other | \n",
" A1 | \n",
" 97 | \n",
" N | \n",
" 2016-06-14 09:40:00 | \n",
" 2016 | \n",
" 6 | \n",
" tuesday | \n",
" 9 | \n",
" part one | \n",
" school st | \n",
" 42.357428 | \n",
" -71.058326 | \n",
"
\n",
" \n",
" 319046 | \n",
" I110372326-00 | \n",
" 3125 | \n",
" warrant arrests | \n",
" warrant arrest | \n",
" A1 | \n",
" 97 | \n",
" N | \n",
" 2016-06-14 09:40:00 | \n",
" 2016 | \n",
" 6 | \n",
" tuesday | \n",
" 9 | \n",
" part three | \n",
" school st | \n",
" 42.357428 | \n",
" -71.058326 | \n",
"
\n",
" \n",
" 319047 | \n",
" I110261417-00 | \n",
" 3125 | \n",
" warrant arrests | \n",
" warrant arrest | \n",
" B2 | \n",
" 324 | \n",
" N | \n",
" 2016-07-29 00:00:00 | \n",
" 2016 | \n",
" 7 | \n",
" friday | \n",
" 0 | \n",
" part three | \n",
" bowdoin st | \n",
" 42.307038 | \n",
" -71.066153 | \n",
"
\n",
" \n",
" 319048 | \n",
" I110261417-00 | \n",
" 619 | \n",
" larceny | \n",
" larceny other $200 & over | \n",
" B2 | \n",
" 324 | \n",
" N | \n",
" 2016-07-29 00:00:00 | \n",
" 2016 | \n",
" 7 | \n",
" friday | \n",
" 0 | \n",
" part one | \n",
" bowdoin st | \n",
" 42.307038 | \n",
" -71.066153 | \n",
"
\n",
" \n",
" 319049 | \n",
" I110177502-00 | \n",
" 3125 | \n",
" warrant arrests | \n",
" warrant arrest | \n",
" B2 | \n",
" 318 | \n",
" N | \n",
" 2015-10-02 21:00:00 | \n",
" 2015 | \n",
" 10 | \n",
" friday | \n",
" 21 | \n",
" part three | \n",
" homestead st | \n",
" 42.311277 | \n",
" -71.089093 | \n",
"
\n",
" \n",
" 319050 | \n",
" I110177502-00 | \n",
" 802 | \n",
" simple assault | \n",
" assault & battery | \n",
" B2 | \n",
" 318 | \n",
" N | \n",
" 2015-10-02 21:00:00 | \n",
" 2015 | \n",
" 10 | \n",
" friday | \n",
" 21 | \n",
" part two | \n",
" homestead st | \n",
" 42.311277 | \n",
" -71.089093 | \n",
"
\n",
" \n",
" 319051 | \n",
" I110177502-00 | \n",
" 3125 | \n",
" warrant arrests | \n",
" warrant arrest | \n",
" B2 | \n",
" 318 | \n",
" N | \n",
" 2015-10-02 21:00:00 | \n",
" 2015 | \n",
" 10 | \n",
" friday | \n",
" 21 | \n",
" part three | \n",
" homestead st | \n",
" 42.311277 | \n",
" -71.089093 | \n",
"
\n",
" \n",
" 319052 | \n",
" I100636670-00 | \n",
" 629 | \n",
" larceny | \n",
" larceny other $50 to $199 | \n",
" D4 | \n",
" 285 | \n",
" N | \n",
" 2016-06-05 17:23:00 | \n",
" 2016 | \n",
" 6 | \n",
" sunday | \n",
" 17 | \n",
" part one | \n",
" coventry st | \n",
" 42.336951 | \n",
" -71.085748 | \n",
"
\n",
" \n",
" 319053 | \n",
" I100636670-00 | \n",
" 3125 | \n",
" warrant arrests | \n",
" warrant arrest | \n",
" D4 | \n",
" 285 | \n",
" N | \n",
" 2016-06-05 17:23:00 | \n",
" 2016 | \n",
" 6 | \n",
" sunday | \n",
" 17 | \n",
" part three | \n",
" coventry st | \n",
" 42.336951 | \n",
" -71.085748 | \n",
"
\n",
" \n",
" 319054 | \n",
" I100340225-00 | \n",
" 3125 | \n",
" warrant arrests | \n",
" warrant arrest | \n",
" A1 | \n",
" 77 | \n",
" N | \n",
" 2015-07-27 10:47:00 | \n",
" 2015 | \n",
" 7 | \n",
" monday | \n",
" 10 | \n",
" part three | \n",
" bowdoin sq | \n",
" 42.361645 | \n",
" -71.062299 | \n",
"
\n",
" \n",
" 319055 | \n",
" I100340225-00 | \n",
" 339 | \n",
" robbery | \n",
" robbery - unarmed - street | \n",
" A1 | \n",
" 77 | \n",
" N | \n",
" 2015-07-27 10:47:00 | \n",
" 2015 | \n",
" 7 | \n",
" monday | \n",
" 10 | \n",
" part one | \n",
" bowdoin sq | \n",
" 42.361645 | \n",
" -71.062299 | \n",
"
\n",
" \n",
" 319056 | \n",
" I100222105-02 | \n",
" 3125 | \n",
" warrant arrests | \n",
" warrant arrest | \n",
" E13 | \n",
" 572 | \n",
" N | \n",
" 2015-08-03 16:22:00 | \n",
" 2015 | \n",
" 8 | \n",
" monday | \n",
" 16 | \n",
" part three | \n",
" columbus ave | \n",
" 42.313628 | \n",
" -71.095603 | \n",
"
\n",
" \n",
" 319057 | \n",
" I100033064-00 | \n",
" 2907 | \n",
" violations | \n",
" val - operating after rev/susp. | \n",
" B2 | \n",
" 304 | \n",
" N | \n",
" 2016-07-29 18:20:00 | \n",
" 2016 | \n",
" 7 | \n",
" friday | \n",
" 18 | \n",
" part two | \n",
" slayton way | \n",
" 42.321770 | \n",
" -71.097798 | \n",
"
\n",
" \n",
" 319058 | \n",
" I100033064-00 | \n",
" 2910 | \n",
" violations | \n",
" val - operating after rev/susp. | \n",
" B2 | \n",
" 304 | \n",
" N | \n",
" 2016-07-29 18:20:00 | \n",
" 2016 | \n",
" 7 | \n",
" friday | \n",
" 18 | \n",
" part two | \n",
" slayton way | \n",
" 42.321770 | \n",
" -71.097798 | \n",
"
\n",
" \n",
" 319061 | \n",
" I090317057-00 | \n",
" 403 | \n",
" aggravated assault | \n",
" assault & battery d/w - other | \n",
" B3 | \n",
" 458 | \n",
" N | \n",
" 2015-11-20 11:15:00 | \n",
" 2015 | \n",
" 11 | \n",
" friday | \n",
" 11 | \n",
" part one | \n",
" blue hill ave | \n",
" 42.301897 | \n",
" -71.085549 | \n",
"
\n",
" \n",
" 319062 | \n",
" I090317057-00 | \n",
" 3125 | \n",
" warrant arrests | \n",
" warrant arrest | \n",
" B3 | \n",
" 458 | \n",
" N | \n",
" 2015-11-20 11:15:00 | \n",
" 2015 | \n",
" 11 | \n",
" friday | \n",
" 11 | \n",
" part three | \n",
" blue hill ave | \n",
" 42.301897 | \n",
" -71.085549 | \n",
"
\n",
" \n",
" 319063 | \n",
" I080542626-00 | \n",
" 3125 | \n",
" warrant arrests | \n",
" warrant arrest | \n",
" A1 | \n",
" 111 | \n",
" N | \n",
" 2015-08-12 12:00:00 | \n",
" 2015 | \n",
" 8 | \n",
" wednesday | \n",
" 12 | \n",
" part three | \n",
" boylston st | \n",
" 42.352312 | \n",
" -71.063705 | \n",
"
\n",
" \n",
" 319064 | \n",
" I080542626-00 | \n",
" 1848 | \n",
" drug violation | \n",
" drugs - poss class b - intent to mfr dist disp | \n",
" A1 | \n",
" 111 | \n",
" N | \n",
" 2015-08-12 12:00:00 | \n",
" 2015 | \n",
" 8 | \n",
" wednesday | \n",
" 12 | \n",
" part two | \n",
" boylston st | \n",
" 42.352312 | \n",
" -71.063705 | \n",
"
\n",
" \n",
" 319065 | \n",
" I080542626-00 | \n",
" 1849 | \n",
" drug violation | \n",
" drugs - poss class b - cocaine, etc. | \n",
" A1 | \n",
" 111 | \n",
" N | \n",
" 2015-08-12 12:00:00 | \n",
" 2015 | \n",
" 8 | \n",
" wednesday | \n",
" 12 | \n",
" part two | \n",
" boylston st | \n",
" 42.352312 | \n",
" -71.063705 | \n",
"
\n",
" \n",
" 319066 | \n",
" I060168073-00 | \n",
" 1864 | \n",
" drug violation | \n",
" drugs - poss class d - intent mfr dist disp | \n",
" E13 | \n",
" 912 | \n",
" N | \n",
" 2018-01-27 14:01:00 | \n",
" 2018 | \n",
" 1 | \n",
" saturday | \n",
" 14 | \n",
" part two | \n",
" centre st | \n",
" 42.322838 | \n",
" -71.100967 | \n",
"
\n",
" \n",
" 319067 | \n",
" I060168073-00 | \n",
" 3125 | \n",
" warrant arrests | \n",
" warrant arrest | \n",
" E13 | \n",
" 912 | \n",
" N | \n",
" 2018-01-27 14:01:00 | \n",
" 2018 | \n",
" 1 | \n",
" saturday | \n",
" 14 | \n",
" part three | \n",
" centre st | \n",
" 42.322838 | \n",
" -71.100967 | \n",
"
\n",
" \n",
" 319068 | \n",
" I050310906-00 | \n",
" 3125 | \n",
" warrant arrests | \n",
" warrant arrest | \n",
" D4 | \n",
" 285 | \n",
" N | \n",
" 2016-06-05 17:25:00 | \n",
" 2016 | \n",
" 6 | \n",
" sunday | \n",
" 17 | \n",
" part three | \n",
" coventry st | \n",
" 42.336951 | \n",
" -71.085748 | \n",
"
\n",
" \n",
" 319069 | \n",
" I030217815-08 | \n",
" 111 | \n",
" homicide | \n",
" murder, non-negligient manslaughter | \n",
" E18 | \n",
" 520 | \n",
" N | \n",
" 2015-07-09 13:38:00 | \n",
" 2015 | \n",
" 7 | \n",
" thursday | \n",
" 13 | \n",
" part one | \n",
" river st | \n",
" 42.255926 | \n",
" -71.123172 | \n",
"
\n",
" \n",
" 319070 | \n",
" I030217815-08 | \n",
" 3125 | \n",
" warrant arrests | \n",
" warrant arrest | \n",
" E18 | \n",
" 520 | \n",
" N | \n",
" 2015-07-09 13:38:00 | \n",
" 2015 | \n",
" 7 | \n",
" thursday | \n",
" 13 | \n",
" part three | \n",
" river st | \n",
" 42.255926 | \n",
" -71.123172 | \n",
"
\n",
" \n",
" 319071 | \n",
" I010370257-00 | \n",
" 3125 | \n",
" warrant arrests | \n",
" warrant arrest | \n",
" E13 | \n",
" 569 | \n",
" N | \n",
" 2016-05-31 19:35:00 | \n",
" 2016 | \n",
" 5 | \n",
" tuesday | \n",
" 19 | \n",
" part three | \n",
" new washington st | \n",
" 42.302333 | \n",
" -71.111565 | \n",
"
\n",
" \n",
" 319072 | \n",
" 142052550 | \n",
" 3125 | \n",
" warrant arrests | \n",
" warrant arrest | \n",
" D4 | \n",
" 903 | \n",
" N | \n",
" 2015-06-22 00:12:00 | \n",
" 2015 | \n",
" 6 | \n",
" monday | \n",
" 0 | \n",
" part three | \n",
" washington st | \n",
" 42.333839 | \n",
" -71.080290 | \n",
"
\n",
" \n",
"
\n",
"
296421 rows × 16 columns
\n",
"
"
],
"text/plain": [
" INCIDENT_NUMBER OFFENSE_CODE OFFENSE_CODE_GROUP \\\n",
"0 I182070945 619 larceny \n",
"1 I182070943 1402 vandalism \n",
"2 I182070941 3410 towed \n",
"3 I182070940 3114 investigate property \n",
"4 I182070938 3114 investigate property \n",
"5 I182070936 3820 motor vehicle accident response \n",
"6 I182070933 724 auto theft \n",
"7 I182070932 3301 verbal disputes \n",
"8 I182070931 301 robbery \n",
"9 I182070929 3301 verbal disputes \n",
"10 I182070928 3301 verbal disputes \n",
"11 I182070927 3114 investigate property \n",
"12 I182070923 3108 fire related reports \n",
"13 I182070922 2647 other \n",
"14 I182070921 3201 property lost \n",
"16 I182070919 3301 verbal disputes \n",
"17 I182070918 3305 assembly or gathering violations \n",
"18 I182070917 2647 other \n",
"19 I182070915 614 larceny from motor vehicle \n",
"21 I182070911 3801 motor vehicle accident response \n",
"22 I182070910 3006 medical assistance \n",
"23 I182070909 3803 motor vehicle accident response \n",
"24 I182070908 522 residential burglary \n",
"26 I182070905 3006 medical assistance \n",
"27 I182070904 802 simple assault \n",
"28 I182070904 2007 restraining order violations \n",
"29 I182070903 2900 other \n",
"30 I182070901 2907 violations \n",
"31 I182070900 2629 harassment \n",
"32 I182070898 802 simple assault \n",
"... ... ... ... \n",
"319040 I110694557-00 3125 warrant arrests \n",
"319041 I110694557-00 3115 investigate person \n",
"319043 I110551302-00 3125 warrant arrests \n",
"319044 I110551302-00 623 larceny \n",
"319045 I110372326-00 403 aggravated assault \n",
"319046 I110372326-00 3125 warrant arrests \n",
"319047 I110261417-00 3125 warrant arrests \n",
"319048 I110261417-00 619 larceny \n",
"319049 I110177502-00 3125 warrant arrests \n",
"319050 I110177502-00 802 simple assault \n",
"319051 I110177502-00 3125 warrant arrests \n",
"319052 I100636670-00 629 larceny \n",
"319053 I100636670-00 3125 warrant arrests \n",
"319054 I100340225-00 3125 warrant arrests \n",
"319055 I100340225-00 339 robbery \n",
"319056 I100222105-02 3125 warrant arrests \n",
"319057 I100033064-00 2907 violations \n",
"319058 I100033064-00 2910 violations \n",
"319061 I090317057-00 403 aggravated assault \n",
"319062 I090317057-00 3125 warrant arrests \n",
"319063 I080542626-00 3125 warrant arrests \n",
"319064 I080542626-00 1848 drug violation \n",
"319065 I080542626-00 1849 drug violation \n",
"319066 I060168073-00 1864 drug violation \n",
"319067 I060168073-00 3125 warrant arrests \n",
"319068 I050310906-00 3125 warrant arrests \n",
"319069 I030217815-08 111 homicide \n",
"319070 I030217815-08 3125 warrant arrests \n",
"319071 I010370257-00 3125 warrant arrests \n",
"319072 142052550 3125 warrant arrests \n",
"\n",
" OFFENSE_DESCRIPTION DISTRICT \\\n",
"0 larceny all others D14 \n",
"1 vandalism C11 \n",
"2 towed motor vehicle D4 \n",
"3 investigate property D4 \n",
"4 investigate property B3 \n",
"5 m/v accident involving pedestrian - injury C11 \n",
"6 auto theft B2 \n",
"7 verbal dispute B2 \n",
"8 robbery - street C6 \n",
"9 verbal dispute C11 \n",
"10 verbal dispute C6 \n",
"11 investigate property C6 \n",
"12 fire report - house, building, etc. D4 \n",
"13 threats to do bodily harm B3 \n",
"14 property - lost B3 \n",
"16 verbal dispute C11 \n",
"17 demonstrations/riot D4 \n",
"18 threats to do bodily harm B2 \n",
"19 larceny theft from mv - non-accessory B2 \n",
"21 m/v accident - other A1 \n",
"22 sick/injured/medical - person B3 \n",
"23 m/v accident - personal injury E5 \n",
"24 burglary - residential - no force B2 \n",
"26 sick/injured/medical - person D4 \n",
"27 assault simple - battery C11 \n",
"28 viol. of restraining order w no arrest C11 \n",
"29 val - violation of auto law - other B3 \n",
"30 val - operating after rev/susp. B3 \n",
"31 harassment B3 \n",
"32 assault simple - battery C11 \n",
"... ... ... \n",
"319040 warrant arrest B3 \n",
"319041 investigate person B3 \n",
"319043 warrant arrest D4 \n",
"319044 larceny shoplifting $50 to $199 D4 \n",
"319045 assault & battery d/w - other A1 \n",
"319046 warrant arrest A1 \n",
"319047 warrant arrest B2 \n",
"319048 larceny other $200 & over B2 \n",
"319049 warrant arrest B2 \n",
"319050 assault & battery B2 \n",
"319051 warrant arrest B2 \n",
"319052 larceny other $50 to $199 D4 \n",
"319053 warrant arrest D4 \n",
"319054 warrant arrest A1 \n",
"319055 robbery - unarmed - street A1 \n",
"319056 warrant arrest E13 \n",
"319057 val - operating after rev/susp. B2 \n",
"319058 val - operating after rev/susp. B2 \n",
"319061 assault & battery d/w - other B3 \n",
"319062 warrant arrest B3 \n",
"319063 warrant arrest A1 \n",
"319064 drugs - poss class b - intent to mfr dist disp A1 \n",
"319065 drugs - poss class b - cocaine, etc. A1 \n",
"319066 drugs - poss class d - intent mfr dist disp E13 \n",
"319067 warrant arrest E13 \n",
"319068 warrant arrest D4 \n",
"319069 murder, non-negligient manslaughter E18 \n",
"319070 warrant arrest E18 \n",
"319071 warrant arrest E13 \n",
"319072 warrant arrest D4 \n",
"\n",
" REPORTING_AREA SHOOTING OCCURRED_ON_DATE YEAR MONTH DAY_OF_WEEK \\\n",
"0 808 N 2018-09-02 13:00:00 2018 9 sunday \n",
"1 347 N 2018-08-21 00:00:00 2018 8 tuesday \n",
"2 151 N 2018-09-03 19:27:00 2018 9 monday \n",
"3 272 N 2018-09-03 21:16:00 2018 9 monday \n",
"4 421 N 2018-09-03 21:05:00 2018 9 monday \n",
"5 398 N 2018-09-03 21:09:00 2018 9 monday \n",
"6 330 N 2018-09-03 21:25:00 2018 9 monday \n",
"7 584 N 2018-09-03 20:39:37 2018 9 monday \n",
"8 177 N 2018-09-03 20:48:00 2018 9 monday \n",
"9 364 N 2018-09-03 20:38:00 2018 9 monday \n",
"10 913 N 2018-09-03 19:55:00 2018 9 monday \n",
"11 936 N 2018-09-03 20:19:00 2018 9 monday \n",
"12 139 N 2018-09-03 19:58:00 2018 9 monday \n",
"13 429 N 2018-09-03 20:39:00 2018 9 monday \n",
"14 469 N 2018-09-02 14:00:00 2018 9 sunday \n",
"16 341 N 2018-09-03 18:52:00 2018 9 monday \n",
"17 130 N 2018-09-03 17:00:00 2018 9 monday \n",
"18 901 N 2018-09-03 19:52:00 2018 9 monday \n",
"19 181 N 2018-09-02 18:00:00 2018 9 sunday \n",
"21 69 N 2018-09-03 18:30:00 2018 9 monday \n",
"22 434 N 2018-09-03 18:42:00 2018 9 monday \n",
"23 550 N 2018-09-03 18:33:00 2018 9 monday \n",
"24 911 N 2018-09-03 18:38:00 2018 9 monday \n",
"26 172 N 2018-09-03 18:50:00 2018 9 monday \n",
"27 242 N 2018-09-03 18:34:00 2018 9 monday \n",
"28 242 N 2018-09-03 18:34:00 2018 9 monday \n",
"29 463 N 2018-09-03 18:55:00 2018 9 monday \n",
"30 428 N 2018-09-03 18:41:00 2018 9 monday \n",
"31 464 N 2018-09-03 18:17:00 2018 9 monday \n",
"32 351 N 2018-09-03 19:11:00 2018 9 monday \n",
"... ... ... ... ... ... ... \n",
"319040 436 N 2016-01-22 09:45:00 2016 1 friday \n",
"319041 436 N 2016-01-22 09:45:00 2016 1 friday \n",
"319043 171 N 2015-07-22 22:00:00 2015 7 wednesday \n",
"319044 171 N 2015-07-22 22:00:00 2015 7 wednesday \n",
"319045 97 N 2016-06-14 09:40:00 2016 6 tuesday \n",
"319046 97 N 2016-06-14 09:40:00 2016 6 tuesday \n",
"319047 324 N 2016-07-29 00:00:00 2016 7 friday \n",
"319048 324 N 2016-07-29 00:00:00 2016 7 friday \n",
"319049 318 N 2015-10-02 21:00:00 2015 10 friday \n",
"319050 318 N 2015-10-02 21:00:00 2015 10 friday \n",
"319051 318 N 2015-10-02 21:00:00 2015 10 friday \n",
"319052 285 N 2016-06-05 17:23:00 2016 6 sunday \n",
"319053 285 N 2016-06-05 17:23:00 2016 6 sunday \n",
"319054 77 N 2015-07-27 10:47:00 2015 7 monday \n",
"319055 77 N 2015-07-27 10:47:00 2015 7 monday \n",
"319056 572 N 2015-08-03 16:22:00 2015 8 monday \n",
"319057 304 N 2016-07-29 18:20:00 2016 7 friday \n",
"319058 304 N 2016-07-29 18:20:00 2016 7 friday \n",
"319061 458 N 2015-11-20 11:15:00 2015 11 friday \n",
"319062 458 N 2015-11-20 11:15:00 2015 11 friday \n",
"319063 111 N 2015-08-12 12:00:00 2015 8 wednesday \n",
"319064 111 N 2015-08-12 12:00:00 2015 8 wednesday \n",
"319065 111 N 2015-08-12 12:00:00 2015 8 wednesday \n",
"319066 912 N 2018-01-27 14:01:00 2018 1 saturday \n",
"319067 912 N 2018-01-27 14:01:00 2018 1 saturday \n",
"319068 285 N 2016-06-05 17:25:00 2016 6 sunday \n",
"319069 520 N 2015-07-09 13:38:00 2015 7 thursday \n",
"319070 520 N 2015-07-09 13:38:00 2015 7 thursday \n",
"319071 569 N 2016-05-31 19:35:00 2016 5 tuesday \n",
"319072 903 N 2015-06-22 00:12:00 2015 6 monday \n",
"\n",
" HOUR UCR_PART STREET Lat Long \n",
"0 13 part one lincoln st 42.357791 -71.139371 \n",
"1 0 part two hecla st 42.306821 -71.060300 \n",
"2 19 part three cazenove st 42.346589 -71.072429 \n",
"3 21 part three newcomb st 42.334182 -71.078664 \n",
"4 21 part three delhi st 42.275365 -71.090361 \n",
"5 21 part three talbot ave 42.290196 -71.071590 \n",
"6 21 part one normandy st 42.306072 -71.082733 \n",
"7 20 part three lawn st 42.327016 -71.105551 \n",
"8 20 part one massachusetts ave 42.331521 -71.070853 \n",
"9 20 part three leslie st 42.295147 -71.058608 \n",
"10 19 part three ocean view dr 42.319579 -71.040328 \n",
"11 20 part three dalessio ct 42.340115 -71.053390 \n",
"12 19 part three marlborough st 42.350388 -71.087853 \n",
"13 20 part two woodrow ave 42.286470 -71.087147 \n",
"14 14 part three mulvey st 42.279241 -71.096674 \n",
"16 18 part three stonehurst st 42.305264 -71.066838 \n",
"17 17 part three huntington ave 42.348577 -71.077720 \n",
"18 19 part two horadan way 42.333717 -71.096658 \n",
"19 18 part one shirley st 42.325695 -71.068168 \n",
"21 18 part three beacon st 42.355644 -71.071681 \n",
"22 18 part three capen st 42.283402 -71.080797 \n",
"23 18 part three washington st 42.275818 -71.139913 \n",
"24 18 part one annunciation rd 42.335062 -71.093168 \n",
"26 18 part three massachusetts ave 42.333112 -71.072764 \n",
"27 18 part two annapolis st 42.317319 -71.061509 \n",
"28 18 part two annapolis st 42.317319 -71.061509 \n",
"29 18 part two blue hill ave 42.295904 -71.087733 \n",
"30 18 part two clarkwood st 42.280137 -71.090798 \n",
"31 18 part two hansborough st 42.288104 -71.091533 \n",
"32 19 part two salisbury park 42.299284 -71.059172 \n",
"... ... ... ... ... ... \n",
"319040 9 part three withington st 42.288767 -71.072897 \n",
"319041 9 part three withington st 42.288767 -71.072897 \n",
"319043 22 part three harrison ave 42.335560 -71.074364 \n",
"319044 22 part one harrison ave 42.335560 -71.074364 \n",
"319045 9 part one school st 42.357428 -71.058326 \n",
"319046 9 part three school st 42.357428 -71.058326 \n",
"319047 0 part three bowdoin st 42.307038 -71.066153 \n",
"319048 0 part one bowdoin st 42.307038 -71.066153 \n",
"319049 21 part three homestead st 42.311277 -71.089093 \n",
"319050 21 part two homestead st 42.311277 -71.089093 \n",
"319051 21 part three homestead st 42.311277 -71.089093 \n",
"319052 17 part one coventry st 42.336951 -71.085748 \n",
"319053 17 part three coventry st 42.336951 -71.085748 \n",
"319054 10 part three bowdoin sq 42.361645 -71.062299 \n",
"319055 10 part one bowdoin sq 42.361645 -71.062299 \n",
"319056 16 part three columbus ave 42.313628 -71.095603 \n",
"319057 18 part two slayton way 42.321770 -71.097798 \n",
"319058 18 part two slayton way 42.321770 -71.097798 \n",
"319061 11 part one blue hill ave 42.301897 -71.085549 \n",
"319062 11 part three blue hill ave 42.301897 -71.085549 \n",
"319063 12 part three boylston st 42.352312 -71.063705 \n",
"319064 12 part two boylston st 42.352312 -71.063705 \n",
"319065 12 part two boylston st 42.352312 -71.063705 \n",
"319066 14 part two centre st 42.322838 -71.100967 \n",
"319067 14 part three centre st 42.322838 -71.100967 \n",
"319068 17 part three coventry st 42.336951 -71.085748 \n",
"319069 13 part one river st 42.255926 -71.123172 \n",
"319070 13 part three river st 42.255926 -71.123172 \n",
"319071 19 part three new washington st 42.302333 -71.111565 \n",
"319072 0 part three washington st 42.333839 -71.080290 \n",
"\n",
"[296421 rows x 16 columns]"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Większość danych o strzelaninach jest pusta więc zakładam, że są to inceydenty bez strzelanin\n",
"crime[\"SHOOTING\"].fillna(\"N\", inplace=True)\n",
"\n",
"# Kolumna location powtarza wartości z Lat i Long\n",
"crime.drop(columns=[\"Location\"], inplace=True)\n",
"\n",
"# Usuwam błędne/brakujące wartości współrzędnych\n",
"crime = crime[(crime[\"Lat\"] > 35) & (crime[\"Long\"] < -65)]\n",
"\n",
"# Lowercase na polach tekstowych\n",
"crime[\"OFFENSE_CODE_GROUP\"] = crime[\"OFFENSE_CODE_GROUP\"].str.lower()\n",
"crime[\"OFFENSE_DESCRIPTION\"] = crime[\"OFFENSE_DESCRIPTION\"].str.lower()\n",
"crime[\"DAY_OF_WEEK\"] = crime[\"DAY_OF_WEEK\"].str.lower()\n",
"crime[\"UCR_PART\"] = crime[\"UCR_PART\"].str.lower()\n",
"crime[\"STREET\"] = crime[\"STREET\"].str.lower()\n",
"\n",
"# Usuwam pozostałe wiersze zawierające nulle\n",
"crime.dropna()"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "lucky-compression",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: scikit-learn in /usr/lib/python3/dist-packages (0.20.2)\n",
"Note: you may need to restart the kernel to use updated packages.\n"
]
}
],
"source": [
"pip install --user scikit-learn"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "further-asset",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(238329, 16)\n",
"(30000, 16)\n",
"(30000, 16)\n"
]
}
],
"source": [
"from sklearn.model_selection import train_test_split\n",
"\n",
"# Zbiór jest całkiem duży - 300k wierszy po oczyszczeniu, więc wybieram podział 8:1:1, czyli w przybliżeniu 30k na dev i test\n",
"crime_train, crime_test = train_test_split(crime, test_size=60000, random_state=1)\n",
"crime_test, crime_dev = train_test_split(crime_test, test_size=30000, random_state=1)\n",
"print(crime_train.shape)\n",
"print(crime_test.shape)\n",
"print(crime_dev.shape)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "united-belly",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" INCIDENT_NUMBER | \n",
" OFFENSE_CODE | \n",
" OFFENSE_CODE_GROUP | \n",
" OFFENSE_DESCRIPTION | \n",
" DISTRICT | \n",
" REPORTING_AREA | \n",
" SHOOTING | \n",
" OCCURRED_ON_DATE | \n",
" YEAR | \n",
" MONTH | \n",
" DAY_OF_WEEK | \n",
" HOUR | \n",
" UCR_PART | \n",
" STREET | \n",
" Lat | \n",
" Long | \n",
"
\n",
" \n",
" \n",
" \n",
" count | \n",
" 238329 | \n",
" 238329.000000 | \n",
" 238329 | \n",
" 238329 | \n",
" 237585 | \n",
" 238329 | \n",
" 238329 | \n",
" 238329 | \n",
" 238329.000000 | \n",
" 238329.000000 | \n",
" 238329 | \n",
" 238329.000000 | \n",
" 238253 | \n",
" 236876 | \n",
" 238329.000000 | \n",
" 238329.000000 | \n",
"
\n",
" \n",
" unique | \n",
" 215646 | \n",
" NaN | \n",
" 66 | \n",
" 233 | \n",
" 12 | \n",
" 878 | \n",
" 2 | \n",
" 183782 | \n",
" NaN | \n",
" NaN | \n",
" 7 | \n",
" NaN | \n",
" 4 | \n",
" 3760 | \n",
" NaN | \n",
" NaN | \n",
"
\n",
" \n",
" top | \n",
" I162030584 | \n",
" NaN | \n",
" motor vehicle accident response | \n",
" sick/injured/medical - person | \n",
" B2 | \n",
" 111 | \n",
" N | \n",
" 2016-08-01 00:00:00 | \n",
" NaN | \n",
" NaN | \n",
" friday | \n",
" NaN | \n",
" part three | \n",
" washington st | \n",
" NaN | \n",
" NaN | \n",
"
\n",
" \n",
" freq | \n",
" 11 | \n",
" NaN | \n",
" 24783 | \n",
" 14380 | \n",
" 36780 | \n",
" 1851 | \n",
" 237575 | \n",
" 22 | \n",
" NaN | \n",
" NaN | \n",
" 36273 | \n",
" NaN | \n",
" 117492 | \n",
" 11305 | \n",
" NaN | \n",
" NaN | \n",
"
\n",
" \n",
" mean | \n",
" NaN | \n",
" 2296.198717 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 2016.551754 | \n",
" 6.615175 | \n",
" NaN | \n",
" 13.129107 | \n",
" NaN | \n",
" NaN | \n",
" 42.322310 | \n",
" -71.082836 | \n",
"
\n",
" \n",
" std | \n",
" NaN | \n",
" 1182.831284 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 1.001031 | \n",
" 3.277604 | \n",
" NaN | \n",
" 6.278188 | \n",
" NaN | \n",
" NaN | \n",
" 0.031891 | \n",
" 0.029754 | \n",
"
\n",
" \n",
" min | \n",
" NaN | \n",
" 111.000000 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 2015.000000 | \n",
" 1.000000 | \n",
" NaN | \n",
" 0.000000 | \n",
" NaN | \n",
" NaN | \n",
" 42.232413 | \n",
" -71.178674 | \n",
"
\n",
" \n",
" 25% | \n",
" NaN | \n",
" 802.000000 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 2016.000000 | \n",
" 4.000000 | \n",
" NaN | \n",
" 9.000000 | \n",
" NaN | \n",
" NaN | \n",
" 42.297555 | \n",
" -71.097193 | \n",
"
\n",
" \n",
" 50% | \n",
" NaN | \n",
" 2907.000000 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 2017.000000 | \n",
" 7.000000 | \n",
" NaN | \n",
" 14.000000 | \n",
" NaN | \n",
" NaN | \n",
" 42.325629 | \n",
" -71.077551 | \n",
"
\n",
" \n",
" 75% | \n",
" NaN | \n",
" 3201.000000 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 2017.000000 | \n",
" 9.000000 | \n",
" NaN | \n",
" 18.000000 | \n",
" NaN | \n",
" NaN | \n",
" 42.348624 | \n",
" -71.062563 | \n",
"
\n",
" \n",
" max | \n",
" NaN | \n",
" 3831.000000 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 2018.000000 | \n",
" 12.000000 | \n",
" NaN | \n",
" 23.000000 | \n",
" NaN | \n",
" NaN | \n",
" 42.395042 | \n",
" -70.963676 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" INCIDENT_NUMBER OFFENSE_CODE OFFENSE_CODE_GROUP \\\n",
"count 238329 238329.000000 238329 \n",
"unique 215646 NaN 66 \n",
"top I162030584 NaN motor vehicle accident response \n",
"freq 11 NaN 24783 \n",
"mean NaN 2296.198717 NaN \n",
"std NaN 1182.831284 NaN \n",
"min NaN 111.000000 NaN \n",
"25% NaN 802.000000 NaN \n",
"50% NaN 2907.000000 NaN \n",
"75% NaN 3201.000000 NaN \n",
"max NaN 3831.000000 NaN \n",
"\n",
" OFFENSE_DESCRIPTION DISTRICT REPORTING_AREA SHOOTING \\\n",
"count 238329 237585 238329 238329 \n",
"unique 233 12 878 2 \n",
"top sick/injured/medical - person B2 111 N \n",
"freq 14380 36780 1851 237575 \n",
"mean NaN NaN NaN NaN \n",
"std NaN NaN NaN NaN \n",
"min NaN NaN NaN NaN \n",
"25% NaN NaN NaN NaN \n",
"50% NaN NaN NaN NaN \n",
"75% NaN NaN NaN NaN \n",
"max NaN NaN NaN NaN \n",
"\n",
" OCCURRED_ON_DATE YEAR MONTH DAY_OF_WEEK \\\n",
"count 238329 238329.000000 238329.000000 238329 \n",
"unique 183782 NaN NaN 7 \n",
"top 2016-08-01 00:00:00 NaN NaN friday \n",
"freq 22 NaN NaN 36273 \n",
"mean NaN 2016.551754 6.615175 NaN \n",
"std NaN 1.001031 3.277604 NaN \n",
"min NaN 2015.000000 1.000000 NaN \n",
"25% NaN 2016.000000 4.000000 NaN \n",
"50% NaN 2017.000000 7.000000 NaN \n",
"75% NaN 2017.000000 9.000000 NaN \n",
"max NaN 2018.000000 12.000000 NaN \n",
"\n",
" HOUR UCR_PART STREET Lat Long \n",
"count 238329.000000 238253 236876 238329.000000 238329.000000 \n",
"unique NaN 4 3760 NaN NaN \n",
"top NaN part three washington st NaN NaN \n",
"freq NaN 117492 11305 NaN NaN \n",
"mean 13.129107 NaN NaN 42.322310 -71.082836 \n",
"std 6.278188 NaN NaN 0.031891 0.029754 \n",
"min 0.000000 NaN NaN 42.232413 -71.178674 \n",
"25% 9.000000 NaN NaN 42.297555 -71.097193 \n",
"50% 14.000000 NaN NaN 42.325629 -71.077551 \n",
"75% 18.000000 NaN NaN 42.348624 -71.062563 \n",
"max 23.000000 NaN NaN 42.395042 -70.963676 "
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"crime_train.describe(include=\"all\")"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "instrumental-procurement",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" INCIDENT_NUMBER | \n",
" OFFENSE_CODE | \n",
" OFFENSE_CODE_GROUP | \n",
" OFFENSE_DESCRIPTION | \n",
" DISTRICT | \n",
" REPORTING_AREA | \n",
" SHOOTING | \n",
" OCCURRED_ON_DATE | \n",
" YEAR | \n",
" MONTH | \n",
" DAY_OF_WEEK | \n",
" HOUR | \n",
" UCR_PART | \n",
" STREET | \n",
" Lat | \n",
" Long | \n",
"
\n",
" \n",
" \n",
" \n",
" count | \n",
" 30000 | \n",
" 30000.000000 | \n",
" 30000 | \n",
" 30000 | \n",
" 29925 | \n",
" 30000 | \n",
" 30000 | \n",
" 30000 | \n",
" 30000.000000 | \n",
" 30000.000000 | \n",
" 30000 | \n",
" 30000.000000 | \n",
" 29995 | \n",
" 29836 | \n",
" 30000.000000 | \n",
" 30000.000000 | \n",
"
\n",
" \n",
" unique | \n",
" 29560 | \n",
" NaN | \n",
" 62 | \n",
" 183 | \n",
" 12 | \n",
" 869 | \n",
" 2 | \n",
" 28717 | \n",
" NaN | \n",
" NaN | \n",
" 7 | \n",
" NaN | \n",
" 4 | \n",
" 2646 | \n",
" NaN | \n",
" NaN | \n",
"
\n",
" \n",
" top | \n",
" I162050329 | \n",
" NaN | \n",
" motor vehicle accident response | \n",
" sick/injured/medical - person | \n",
" B2 | \n",
" 111 | \n",
" N | \n",
" 2015-12-16 20:00:00 | \n",
" NaN | \n",
" NaN | \n",
" friday | \n",
" NaN | \n",
" part three | \n",
" washington st | \n",
" NaN | \n",
" NaN | \n",
"
\n",
" \n",
" freq | \n",
" 4 | \n",
" NaN | \n",
" 3087 | \n",
" 1800 | \n",
" 4659 | \n",
" 229 | \n",
" 29889 | \n",
" 6 | \n",
" NaN | \n",
" NaN | \n",
" 4667 | \n",
" NaN | \n",
" 14698 | \n",
" 1374 | \n",
" NaN | \n",
" NaN | \n",
"
\n",
" \n",
" mean | \n",
" NaN | \n",
" 2289.794500 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 2016.560633 | \n",
" 6.584300 | \n",
" NaN | \n",
" 13.063833 | \n",
" NaN | \n",
" NaN | \n",
" 42.322205 | \n",
" -71.082903 | \n",
"
\n",
" \n",
" std | \n",
" NaN | \n",
" 1182.877414 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 0.996171 | \n",
" 3.295642 | \n",
" NaN | \n",
" 6.281078 | \n",
" NaN | \n",
" NaN | \n",
" 0.031885 | \n",
" 0.029818 | \n",
"
\n",
" \n",
" min | \n",
" NaN | \n",
" 111.000000 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 2015.000000 | \n",
" 1.000000 | \n",
" NaN | \n",
" 0.000000 | \n",
" NaN | \n",
" NaN | \n",
" 42.233157 | \n",
" -71.176805 | \n",
"
\n",
" \n",
" 25% | \n",
" NaN | \n",
" 802.000000 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 2016.000000 | \n",
" 4.000000 | \n",
" NaN | \n",
" 9.000000 | \n",
" NaN | \n",
" NaN | \n",
" 42.297344 | \n",
" -71.097374 | \n",
"
\n",
" \n",
" 50% | \n",
" NaN | \n",
" 2906.000000 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 2017.000000 | \n",
" 7.000000 | \n",
" NaN | \n",
" 14.000000 | \n",
" NaN | \n",
" NaN | \n",
" 42.325474 | \n",
" -71.077720 | \n",
"
\n",
" \n",
" 75% | \n",
" NaN | \n",
" 3201.000000 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 2017.000000 | \n",
" 9.000000 | \n",
" NaN | \n",
" 18.000000 | \n",
" NaN | \n",
" NaN | \n",
" 42.348610 | \n",
" -71.062570 | \n",
"
\n",
" \n",
" max | \n",
" NaN | \n",
" 3831.000000 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 2018.000000 | \n",
" 12.000000 | \n",
" NaN | \n",
" 23.000000 | \n",
" NaN | \n",
" NaN | \n",
" 42.395042 | \n",
" -70.996769 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" INCIDENT_NUMBER OFFENSE_CODE OFFENSE_CODE_GROUP \\\n",
"count 30000 30000.000000 30000 \n",
"unique 29560 NaN 62 \n",
"top I162050329 NaN motor vehicle accident response \n",
"freq 4 NaN 3087 \n",
"mean NaN 2289.794500 NaN \n",
"std NaN 1182.877414 NaN \n",
"min NaN 111.000000 NaN \n",
"25% NaN 802.000000 NaN \n",
"50% NaN 2906.000000 NaN \n",
"75% NaN 3201.000000 NaN \n",
"max NaN 3831.000000 NaN \n",
"\n",
" OFFENSE_DESCRIPTION DISTRICT REPORTING_AREA SHOOTING \\\n",
"count 30000 29925 30000 30000 \n",
"unique 183 12 869 2 \n",
"top sick/injured/medical - person B2 111 N \n",
"freq 1800 4659 229 29889 \n",
"mean NaN NaN NaN NaN \n",
"std NaN NaN NaN NaN \n",
"min NaN NaN NaN NaN \n",
"25% NaN NaN NaN NaN \n",
"50% NaN NaN NaN NaN \n",
"75% NaN NaN NaN NaN \n",
"max NaN NaN NaN NaN \n",
"\n",
" OCCURRED_ON_DATE YEAR MONTH DAY_OF_WEEK \\\n",
"count 30000 30000.000000 30000.000000 30000 \n",
"unique 28717 NaN NaN 7 \n",
"top 2015-12-16 20:00:00 NaN NaN friday \n",
"freq 6 NaN NaN 4667 \n",
"mean NaN 2016.560633 6.584300 NaN \n",
"std NaN 0.996171 3.295642 NaN \n",
"min NaN 2015.000000 1.000000 NaN \n",
"25% NaN 2016.000000 4.000000 NaN \n",
"50% NaN 2017.000000 7.000000 NaN \n",
"75% NaN 2017.000000 9.000000 NaN \n",
"max NaN 2018.000000 12.000000 NaN \n",
"\n",
" HOUR UCR_PART STREET Lat Long \n",
"count 30000.000000 29995 29836 30000.000000 30000.000000 \n",
"unique NaN 4 2646 NaN NaN \n",
"top NaN part three washington st NaN NaN \n",
"freq NaN 14698 1374 NaN NaN \n",
"mean 13.063833 NaN NaN 42.322205 -71.082903 \n",
"std 6.281078 NaN NaN 0.031885 0.029818 \n",
"min 0.000000 NaN NaN 42.233157 -71.176805 \n",
"25% 9.000000 NaN NaN 42.297344 -71.097374 \n",
"50% 14.000000 NaN NaN 42.325474 -71.077720 \n",
"75% 18.000000 NaN NaN 42.348610 -71.062570 \n",
"max 23.000000 NaN NaN 42.395042 -70.996769 "
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"crime_test.describe(include=\"all\")"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "piano-gambling",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" INCIDENT_NUMBER | \n",
" OFFENSE_CODE | \n",
" OFFENSE_CODE_GROUP | \n",
" OFFENSE_DESCRIPTION | \n",
" DISTRICT | \n",
" REPORTING_AREA | \n",
" SHOOTING | \n",
" OCCURRED_ON_DATE | \n",
" YEAR | \n",
" MONTH | \n",
" DAY_OF_WEEK | \n",
" HOUR | \n",
" UCR_PART | \n",
" STREET | \n",
" Lat | \n",
" Long | \n",
"
\n",
" \n",
" \n",
" \n",
" count | \n",
" 30000 | \n",
" 30000.000000 | \n",
" 30000 | \n",
" 30000 | \n",
" 29922 | \n",
" 30000 | \n",
" 30000 | \n",
" 30000 | \n",
" 30000.000000 | \n",
" 30000.000000 | \n",
" 30000 | \n",
" 30000.000000 | \n",
" 29991 | \n",
" 29836 | \n",
" 30000.000000 | \n",
" 30000.000000 | \n",
"
\n",
" \n",
" unique | \n",
" 29561 | \n",
" NaN | \n",
" 61 | \n",
" 189 | \n",
" 12 | \n",
" 868 | \n",
" 2 | \n",
" 28778 | \n",
" NaN | \n",
" NaN | \n",
" 7 | \n",
" NaN | \n",
" 4 | \n",
" 2689 | \n",
" NaN | \n",
" NaN | \n",
"
\n",
" \n",
" top | \n",
" I162010747 | \n",
" NaN | \n",
" motor vehicle accident response | \n",
" investigate person | \n",
" B2 | \n",
" 111 | \n",
" N | \n",
" 2017-06-01 00:00:00 | \n",
" NaN | \n",
" NaN | \n",
" thursday | \n",
" NaN | \n",
" part three | \n",
" washington st | \n",
" NaN | \n",
" NaN | \n",
"
\n",
" \n",
" freq | \n",
" 4 | \n",
" NaN | \n",
" 3145 | \n",
" 1908 | \n",
" 4762 | \n",
" 258 | \n",
" 29882 | \n",
" 6 | \n",
" NaN | \n",
" NaN | \n",
" 4425 | \n",
" NaN | \n",
" 14910 | \n",
" 1434 | \n",
" NaN | \n",
" NaN | \n",
"
\n",
" \n",
" mean | \n",
" NaN | \n",
" 2303.541933 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 2016.560700 | \n",
" 6.626700 | \n",
" NaN | \n",
" 13.157033 | \n",
" NaN | \n",
" NaN | \n",
" 42.322292 | \n",
" -71.082911 | \n",
"
\n",
" \n",
" std | \n",
" NaN | \n",
" 1185.561127 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 0.998874 | \n",
" 3.264563 | \n",
" NaN | \n",
" 6.282363 | \n",
" NaN | \n",
" NaN | \n",
" 0.031804 | \n",
" 0.029857 | \n",
"
\n",
" \n",
" min | \n",
" NaN | \n",
" 111.000000 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 2015.000000 | \n",
" 1.000000 | \n",
" NaN | \n",
" 0.000000 | \n",
" NaN | \n",
" NaN | \n",
" 42.232656 | \n",
" -71.178674 | \n",
"
\n",
" \n",
" 25% | \n",
" NaN | \n",
" 802.000000 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 2016.000000 | \n",
" 4.000000 | \n",
" NaN | \n",
" 9.000000 | \n",
" NaN | \n",
" NaN | \n",
" 42.297555 | \n",
" -71.097193 | \n",
"
\n",
" \n",
" 50% | \n",
" NaN | \n",
" 2907.000000 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 2017.000000 | \n",
" 7.000000 | \n",
" NaN | \n",
" 14.000000 | \n",
" NaN | \n",
" NaN | \n",
" 42.325834 | \n",
" -71.077564 | \n",
"
\n",
" \n",
" 75% | \n",
" NaN | \n",
" 3201.000000 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 2017.000000 | \n",
" 9.000000 | \n",
" NaN | \n",
" 18.000000 | \n",
" NaN | \n",
" NaN | \n",
" 42.348610 | \n",
" -71.062607 | \n",
"
\n",
" \n",
" max | \n",
" NaN | \n",
" 3831.000000 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 2018.000000 | \n",
" 12.000000 | \n",
" NaN | \n",
" 23.000000 | \n",
" NaN | \n",
" NaN | \n",
" 42.395042 | \n",
" -70.996769 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" INCIDENT_NUMBER OFFENSE_CODE OFFENSE_CODE_GROUP \\\n",
"count 30000 30000.000000 30000 \n",
"unique 29561 NaN 61 \n",
"top I162010747 NaN motor vehicle accident response \n",
"freq 4 NaN 3145 \n",
"mean NaN 2303.541933 NaN \n",
"std NaN 1185.561127 NaN \n",
"min NaN 111.000000 NaN \n",
"25% NaN 802.000000 NaN \n",
"50% NaN 2907.000000 NaN \n",
"75% NaN 3201.000000 NaN \n",
"max NaN 3831.000000 NaN \n",
"\n",
" OFFENSE_DESCRIPTION DISTRICT REPORTING_AREA SHOOTING \\\n",
"count 30000 29922 30000 30000 \n",
"unique 189 12 868 2 \n",
"top investigate person B2 111 N \n",
"freq 1908 4762 258 29882 \n",
"mean NaN NaN NaN NaN \n",
"std NaN NaN NaN NaN \n",
"min NaN NaN NaN NaN \n",
"25% NaN NaN NaN NaN \n",
"50% NaN NaN NaN NaN \n",
"75% NaN NaN NaN NaN \n",
"max NaN NaN NaN NaN \n",
"\n",
" OCCURRED_ON_DATE YEAR MONTH DAY_OF_WEEK \\\n",
"count 30000 30000.000000 30000.000000 30000 \n",
"unique 28778 NaN NaN 7 \n",
"top 2017-06-01 00:00:00 NaN NaN thursday \n",
"freq 6 NaN NaN 4425 \n",
"mean NaN 2016.560700 6.626700 NaN \n",
"std NaN 0.998874 3.264563 NaN \n",
"min NaN 2015.000000 1.000000 NaN \n",
"25% NaN 2016.000000 4.000000 NaN \n",
"50% NaN 2017.000000 7.000000 NaN \n",
"75% NaN 2017.000000 9.000000 NaN \n",
"max NaN 2018.000000 12.000000 NaN \n",
"\n",
" HOUR UCR_PART STREET Lat Long \n",
"count 30000.000000 29991 29836 30000.000000 30000.000000 \n",
"unique NaN 4 2689 NaN NaN \n",
"top NaN part three washington st NaN NaN \n",
"freq NaN 14910 1434 NaN NaN \n",
"mean 13.157033 NaN NaN 42.322292 -71.082911 \n",
"std 6.282363 NaN NaN 0.031804 0.029857 \n",
"min 0.000000 NaN NaN 42.232656 -71.178674 \n",
"25% 9.000000 NaN NaN 42.297555 -71.097193 \n",
"50% 14.000000 NaN NaN 42.325834 -71.077564 \n",
"75% 18.000000 NaN NaN 42.348610 -71.062607 \n",
"max 23.000000 NaN NaN 42.395042 -70.996769 "
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"crime_dev.describe(include=\"all\")"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "historical-rebecca",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"3006 14380\n",
"3115 14336\n",
"1402 11677\n",
"3831 11635\n",
"802 11229\n",
"3301 10373\n",
"3410 8577\n",
"3114 8462\n",
"617 7114\n",
"2647 7010\n",
"3201 6734\n",
"614 6614\n",
"613 6250\n",
"3125 6060\n",
"619 4490\n",
"3802 4308\n",
"413 3625\n",
"3502 3470\n",
"1102 3461\n",
"2629 3159\n",
"3803 3123\n",
"3501 2975\n",
"3207 2763\n",
"724 2676\n",
"1106 2466\n",
"2610 2461\n",
"301 2182\n",
"423 2162\n",
"520 2039\n",
"2900 1973\n",
" ... \n",
"1302 2\n",
"2910 2\n",
"1002 2\n",
"803 2\n",
"2672 2\n",
"629 2\n",
"1866 2\n",
"633 2\n",
"123 2\n",
"770 2\n",
"1807 2\n",
"627 1\n",
"349 1\n",
"624 1\n",
"112 1\n",
"402 1\n",
"527 1\n",
"637 1\n",
"530 1\n",
"1620 1\n",
"2609 1\n",
"404 1\n",
"1105 1\n",
"547 1\n",
"335 1\n",
"315 1\n",
"714 1\n",
"1864 1\n",
"1863 1\n",
"639 1\n",
"Name: OFFENSE_CODE, Length: 215, dtype: int64"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"crime_train[\"OFFENSE_CODE\"].value_counts()"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "advance-profile",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"B2 36780\n",
"C11 32723\n",
"D4 30659\n",
"B3 26864\n",
"A1 25879\n",
"C6 17285\n",
"D14 15259\n",
"E18 13366\n",
"E13 13297\n",
"A7 10412\n",
"E5 10149\n",
"A15 4912\n",
"Name: DISTRICT, dtype: int64"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"crime_train[\"DISTRICT\"].value_counts()"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "three-horizontal",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"2017 74671\n",
"2016 73720\n",
"2018 48922\n",
"2015 41016\n",
"Name: YEAR, dtype: int64"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"crime_train[\"YEAR\"].value_counts()"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "certain-opera",
"metadata": {},
"outputs": [],
"source": [
"crime_test.to_csv(\"crime_test.csv\", encoding=\"utf-8\", index=False)\n",
"crime_dev.to_csv(\"crime_dev.csv\", encoding=\"utf-8\", index=False)\n",
"crime_train.to_csv(\"crime_train.csv\", encoding=\"utf-8\", index=False)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}