{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Chapter 3 Which borough has the most noise complaints?"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Populating the interactive namespace from numpy and matplotlib\n",
"line_width has been deprecated, use display.width instead (currently both are\n",
"identical)\n",
"\n"
]
}
],
"source": [
"%pylab inline\n",
"import pandas as pd\n",
"\n",
"# Make the graphs a bit prettier, and bigger\n",
"pd.set_option('display.mpl_style', 'default')\n",
"figsize(15, 5)\n",
"\n",
"# Always display all the columns\n",
"pd.set_option('display.line_width', 5000) \n",
"pd.set_option('display.max_columns', 60) \n",
"\n",
"import matplotlib\n",
"matplotlib.style.use('ggplot')"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/usr/local/lib/python2.7/site-packages/IPython/core/interactiveshell.py:2723: DtypeWarning: Columns (8) have mixed types. Specify dtype option on import or set low_memory=False.\n",
" interactivity=interactivity, compiler=compiler, result=result)\n"
]
}
],
"source": [
"complaints = pd.read_csv('./data/311-service-requests.csv')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 3.1 Selecting only noise complaints"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"
\n",
" \n",
" \n",
" | \n",
" Unique Key | \n",
" Created Date | \n",
" Closed Date | \n",
" Agency | \n",
" Agency Name | \n",
" Complaint Type | \n",
" Descriptor | \n",
" Location Type | \n",
" Incident Zip | \n",
" Incident Address | \n",
" Street Name | \n",
" Cross Street 1 | \n",
" Cross Street 2 | \n",
" Intersection Street 1 | \n",
" Intersection Street 2 | \n",
" Address Type | \n",
" City | \n",
" Landmark | \n",
" Facility Type | \n",
" Status | \n",
" Due Date | \n",
" Resolution Action Updated Date | \n",
" Community Board | \n",
" Borough | \n",
" X Coordinate (State Plane) | \n",
" Y Coordinate (State Plane) | \n",
" Park Facility Name | \n",
" Park Borough | \n",
" School Name | \n",
" School Number | \n",
" School Region | \n",
" School Code | \n",
" School Phone Number | \n",
" School Address | \n",
" School City | \n",
" School State | \n",
" School Zip | \n",
" School Not Found | \n",
" School or Citywide Complaint | \n",
" Vehicle Type | \n",
" Taxi Company Borough | \n",
" Taxi Pick Up Location | \n",
" Bridge Highway Name | \n",
" Bridge Highway Direction | \n",
" Road Ramp | \n",
" Bridge Highway Segment | \n",
" Garage Lot Name | \n",
" Ferry Direction | \n",
" Ferry Terminal Name | \n",
" Latitude | \n",
" Longitude | \n",
" Location | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" 26589651 | \n",
" 10/31/2013 02:08:41 AM | \n",
" NaN | \n",
" NYPD | \n",
" New York City Police Department | \n",
" Noise - Street/Sidewalk | \n",
" Loud Talking | \n",
" Street/Sidewalk | \n",
" 11432 | \n",
" 90-03 169 STREET | \n",
" 169 STREET | \n",
" 90 AVENUE | \n",
" 91 AVENUE | \n",
" NaN | \n",
" NaN | \n",
" ADDRESS | \n",
" JAMAICA | \n",
" NaN | \n",
" Precinct | \n",
" Assigned | \n",
" 10/31/2013 10:08:41 AM | \n",
" 10/31/2013 02:35:17 AM | \n",
" 12 QUEENS | \n",
" QUEENS | \n",
" 1042027 | \n",
" 197389 | \n",
" Unspecified | \n",
" QUEENS | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" N | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 40.708275 | \n",
" -73.791604 | \n",
" (40.70827532593202, -73.79160395779721) | \n",
"
\n",
" \n",
" | 1 | \n",
" 26593698 | \n",
" 10/31/2013 02:01:04 AM | \n",
" NaN | \n",
" NYPD | \n",
" New York City Police Department | \n",
" Illegal Parking | \n",
" Commercial Overnight Parking | \n",
" Street/Sidewalk | \n",
" 11378 | \n",
" 58 AVENUE | \n",
" 58 AVENUE | \n",
" 58 PLACE | \n",
" 59 STREET | \n",
" NaN | \n",
" NaN | \n",
" BLOCKFACE | \n",
" MASPETH | \n",
" NaN | \n",
" Precinct | \n",
" Open | \n",
" 10/31/2013 10:01:04 AM | \n",
" NaN | \n",
" 05 QUEENS | \n",
" QUEENS | \n",
" 1009349 | \n",
" 201984 | \n",
" Unspecified | \n",
" QUEENS | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" N | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 40.721041 | \n",
" -73.909453 | \n",
" (40.721040535628305, -73.90945306791765) | \n",
"
\n",
" \n",
" | 2 | \n",
" 26594139 | \n",
" 10/31/2013 02:00:24 AM | \n",
" 10/31/2013 02:40:32 AM | \n",
" NYPD | \n",
" New York City Police Department | \n",
" Noise - Commercial | \n",
" Loud Music/Party | \n",
" Club/Bar/Restaurant | \n",
" 10032 | \n",
" 4060 BROADWAY | \n",
" BROADWAY | \n",
" WEST 171 STREET | \n",
" WEST 172 STREET | \n",
" NaN | \n",
" NaN | \n",
" ADDRESS | \n",
" NEW YORK | \n",
" NaN | \n",
" Precinct | \n",
" Closed | \n",
" 10/31/2013 10:00:24 AM | \n",
" 10/31/2013 02:39:42 AM | \n",
" 12 MANHATTAN | \n",
" MANHATTAN | \n",
" 1001088 | \n",
" 246531 | \n",
" Unspecified | \n",
" MANHATTAN | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" N | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 40.843330 | \n",
" -73.939144 | \n",
" (40.84332975466513, -73.93914371913482) | \n",
"
\n",
" \n",
" | 3 | \n",
" 26595721 | \n",
" 10/31/2013 01:56:23 AM | \n",
" 10/31/2013 02:21:48 AM | \n",
" NYPD | \n",
" New York City Police Department | \n",
" Noise - Vehicle | \n",
" Car/Truck Horn | \n",
" Street/Sidewalk | \n",
" 10023 | \n",
" WEST 72 STREET | \n",
" WEST 72 STREET | \n",
" COLUMBUS AVENUE | \n",
" AMSTERDAM AVENUE | \n",
" NaN | \n",
" NaN | \n",
" BLOCKFACE | \n",
" NEW YORK | \n",
" NaN | \n",
" Precinct | \n",
" Closed | \n",
" 10/31/2013 09:56:23 AM | \n",
" 10/31/2013 02:21:10 AM | \n",
" 07 MANHATTAN | \n",
" MANHATTAN | \n",
" 989730 | \n",
" 222727 | \n",
" Unspecified | \n",
" MANHATTAN | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" N | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 40.778009 | \n",
" -73.980213 | \n",
" (40.7780087446372, -73.98021349023975) | \n",
"
\n",
" \n",
" | 4 | \n",
" 26590930 | \n",
" 10/31/2013 01:53:44 AM | \n",
" NaN | \n",
" DOHMH | \n",
" Department of Health and Mental Hygiene | \n",
" Rodent | \n",
" Condition Attracting Rodents | \n",
" Vacant Lot | \n",
" 10027 | \n",
" WEST 124 STREET | \n",
" WEST 124 STREET | \n",
" LENOX AVENUE | \n",
" ADAM CLAYTON POWELL JR BOULEVARD | \n",
" NaN | \n",
" NaN | \n",
" BLOCKFACE | \n",
" NEW YORK | \n",
" NaN | \n",
" NaN | \n",
" Pending | \n",
" 11/30/2013 01:53:44 AM | \n",
" 10/31/2013 01:59:54 AM | \n",
" 10 MANHATTAN | \n",
" MANHATTAN | \n",
" 998815 | \n",
" 233545 | \n",
" Unspecified | \n",
" MANHATTAN | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" N | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 40.807691 | \n",
" -73.947387 | \n",
" (40.80769092704951, -73.94738703491433) | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Unique Key Created Date Closed Date Agency Agency Name Complaint Type Descriptor Location Type Incident Zip Incident Address Street Name Cross Street 1 Cross Street 2 Intersection Street 1 Intersection Street 2 Address Type City Landmark Facility Type Status Due Date Resolution Action Updated Date Community Board Borough X Coordinate (State Plane) Y Coordinate (State Plane) Park Facility Name Park Borough School Name School Number School Region School Code School Phone Number School Address School City School State School Zip School Not Found School or Citywide Complaint Vehicle Type Taxi Company Borough Taxi Pick Up Location Bridge Highway Name Bridge Highway Direction Road Ramp Bridge Highway Segment Garage Lot Name Ferry Direction Ferry Terminal Name Latitude Longitude Location\n",
"0 26589651 10/31/2013 02:08:41 AM NaN NYPD New York City Police Department Noise - Street/Sidewalk Loud Talking Street/Sidewalk 11432 90-03 169 STREET 169 STREET 90 AVENUE 91 AVENUE NaN NaN ADDRESS JAMAICA NaN Precinct Assigned 10/31/2013 10:08:41 AM 10/31/2013 02:35:17 AM 12 QUEENS QUEENS 1042027 197389 Unspecified QUEENS Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified N NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 40.708275 -73.791604 (40.70827532593202, -73.79160395779721)\n",
"1 26593698 10/31/2013 02:01:04 AM NaN NYPD New York City Police Department Illegal Parking Commercial Overnight Parking Street/Sidewalk 11378 58 AVENUE 58 AVENUE 58 PLACE 59 STREET NaN NaN BLOCKFACE MASPETH NaN Precinct Open 10/31/2013 10:01:04 AM NaN 05 QUEENS QUEENS 1009349 201984 Unspecified QUEENS Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified N NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 40.721041 -73.909453 (40.721040535628305, -73.90945306791765)\n",
"2 26594139 10/31/2013 02:00:24 AM 10/31/2013 02:40:32 AM NYPD New York City Police Department Noise - Commercial Loud Music/Party Club/Bar/Restaurant 10032 4060 BROADWAY BROADWAY WEST 171 STREET WEST 172 STREET NaN NaN ADDRESS NEW YORK NaN Precinct Closed 10/31/2013 10:00:24 AM 10/31/2013 02:39:42 AM 12 MANHATTAN MANHATTAN 1001088 246531 Unspecified MANHATTAN Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified N NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 40.843330 -73.939144 (40.84332975466513, -73.93914371913482)\n",
"3 26595721 10/31/2013 01:56:23 AM 10/31/2013 02:21:48 AM NYPD New York City Police Department Noise - Vehicle Car/Truck Horn Street/Sidewalk 10023 WEST 72 STREET WEST 72 STREET COLUMBUS AVENUE AMSTERDAM AVENUE NaN NaN BLOCKFACE NEW YORK NaN Precinct Closed 10/31/2013 09:56:23 AM 10/31/2013 02:21:10 AM 07 MANHATTAN MANHATTAN 989730 222727 Unspecified MANHATTAN Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified N NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 40.778009 -73.980213 (40.7780087446372, -73.98021349023975)\n",
"4 26590930 10/31/2013 01:53:44 AM NaN DOHMH Department of Health and Mental Hygiene Rodent Condition Attracting Rodents Vacant Lot 10027 WEST 124 STREET WEST 124 STREET LENOX AVENUE ADAM CLAYTON POWELL JR BOULEVARD NaN NaN BLOCKFACE NEW YORK NaN NaN Pending 11/30/2013 01:53:44 AM 10/31/2013 01:59:54 AM 10 MANHATTAN MANHATTAN 998815 233545 Unspecified MANHATTAN Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified N NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 40.807691 -73.947387 (40.80769092704951, -73.94738703491433)"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"complaints[: 5]"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"noise_complaints = complaints[complaints['Complaint Type'] == 'Noise - Street/Sidewalk']"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Unique Key | \n",
" Created Date | \n",
" Closed Date | \n",
" Agency | \n",
" Agency Name | \n",
" Complaint Type | \n",
" Descriptor | \n",
" Location Type | \n",
" Incident Zip | \n",
" Incident Address | \n",
" Street Name | \n",
" Cross Street 1 | \n",
" Cross Street 2 | \n",
" Intersection Street 1 | \n",
" Intersection Street 2 | \n",
" Address Type | \n",
" City | \n",
" Landmark | \n",
" Facility Type | \n",
" Status | \n",
" Due Date | \n",
" Resolution Action Updated Date | \n",
" Community Board | \n",
" Borough | \n",
" X Coordinate (State Plane) | \n",
" Y Coordinate (State Plane) | \n",
" Park Facility Name | \n",
" Park Borough | \n",
" School Name | \n",
" School Number | \n",
" School Region | \n",
" School Code | \n",
" School Phone Number | \n",
" School Address | \n",
" School City | \n",
" School State | \n",
" School Zip | \n",
" School Not Found | \n",
" School or Citywide Complaint | \n",
" Vehicle Type | \n",
" Taxi Company Borough | \n",
" Taxi Pick Up Location | \n",
" Bridge Highway Name | \n",
" Bridge Highway Direction | \n",
" Road Ramp | \n",
" Bridge Highway Segment | \n",
" Garage Lot Name | \n",
" Ferry Direction | \n",
" Ferry Terminal Name | \n",
" Latitude | \n",
" Longitude | \n",
" Location | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" 26589651 | \n",
" 10/31/2013 02:08:41 AM | \n",
" NaN | \n",
" NYPD | \n",
" New York City Police Department | \n",
" Noise - Street/Sidewalk | \n",
" Loud Talking | \n",
" Street/Sidewalk | \n",
" 11432 | \n",
" 90-03 169 STREET | \n",
" 169 STREET | \n",
" 90 AVENUE | \n",
" 91 AVENUE | \n",
" NaN | \n",
" NaN | \n",
" ADDRESS | \n",
" JAMAICA | \n",
" NaN | \n",
" Precinct | \n",
" Assigned | \n",
" 10/31/2013 10:08:41 AM | \n",
" 10/31/2013 02:35:17 AM | \n",
" 12 QUEENS | \n",
" QUEENS | \n",
" 1042027 | \n",
" 197389 | \n",
" Unspecified | \n",
" QUEENS | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" N | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 40.708275 | \n",
" -73.791604 | \n",
" (40.70827532593202, -73.79160395779721) | \n",
"
\n",
" \n",
" | 16 | \n",
" 26594086 | \n",
" 10/31/2013 12:54:03 AM | \n",
" 10/31/2013 02:16:39 AM | \n",
" NYPD | \n",
" New York City Police Department | \n",
" Noise - Street/Sidewalk | \n",
" Loud Music/Party | \n",
" Street/Sidewalk | \n",
" 10310 | \n",
" 173 CAMPBELL AVENUE | \n",
" CAMPBELL AVENUE | \n",
" HENDERSON AVENUE | \n",
" WINEGAR LANE | \n",
" NaN | \n",
" NaN | \n",
" ADDRESS | \n",
" STATEN ISLAND | \n",
" NaN | \n",
" Precinct | \n",
" Closed | \n",
" 10/31/2013 08:54:03 AM | \n",
" 10/31/2013 02:07:14 AM | \n",
" 01 STATEN ISLAND | \n",
" STATEN ISLAND | \n",
" 952013 | \n",
" 171076 | \n",
" Unspecified | \n",
" STATEN ISLAND | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" N | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 40.636182 | \n",
" -74.116150 | \n",
" (40.63618202176914, -74.1161500428337) | \n",
"
\n",
" \n",
" | 25 | \n",
" 26591573 | \n",
" 10/31/2013 12:35:18 AM | \n",
" 10/31/2013 02:41:35 AM | \n",
" NYPD | \n",
" New York City Police Department | \n",
" Noise - Street/Sidewalk | \n",
" Loud Talking | \n",
" Street/Sidewalk | \n",
" 10312 | \n",
" 24 PRINCETON LANE | \n",
" PRINCETON LANE | \n",
" HAMPTON GREEN | \n",
" DEAD END | \n",
" NaN | \n",
" NaN | \n",
" ADDRESS | \n",
" STATEN ISLAND | \n",
" NaN | \n",
" Precinct | \n",
" Closed | \n",
" 10/31/2013 08:35:18 AM | \n",
" 10/31/2013 01:45:17 AM | \n",
" 03 STATEN ISLAND | \n",
" STATEN ISLAND | \n",
" 929577 | \n",
" 140964 | \n",
" Unspecified | \n",
" STATEN ISLAND | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" N | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 40.553421 | \n",
" -74.196743 | \n",
" (40.55342078716953, -74.19674315017886) | \n",
"
\n",
" \n",
" | 28 | \n",
" 26594085 | \n",
" 10/31/2013 12:32:08 AM | \n",
" NaN | \n",
" NYPD | \n",
" New York City Police Department | \n",
" Noise - Street/Sidewalk | \n",
" Loud Talking | \n",
" Street/Sidewalk | \n",
" 10026 | \n",
" 121 WEST 116 STREET | \n",
" WEST 116 STREET | \n",
" LENOX AVENUE | \n",
" 7 AVENUE | \n",
" NaN | \n",
" NaN | \n",
" ADDRESS | \n",
" NEW YORK | \n",
" NaN | \n",
" Precinct | \n",
" Assigned | \n",
" 10/31/2013 08:32:08 AM | \n",
" 10/31/2013 02:00:57 AM | \n",
" 10 MANHATTAN | \n",
" MANHATTAN | \n",
" 997947 | \n",
" 231613 | \n",
" Unspecified | \n",
" MANHATTAN | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" N | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 40.802390 | \n",
" -73.950526 | \n",
" (40.80238950799943, -73.95052644123253) | \n",
"
\n",
" \n",
" | 31 | \n",
" 26595564 | \n",
" 10/31/2013 12:30:36 AM | \n",
" NaN | \n",
" NYPD | \n",
" New York City Police Department | \n",
" Noise - Street/Sidewalk | \n",
" Loud Music/Party | \n",
" Street/Sidewalk | \n",
" 11236 | \n",
" AVENUE J | \n",
" AVENUE J | \n",
" EAST 80 STREET | \n",
" EAST 81 STREET | \n",
" NaN | \n",
" NaN | \n",
" BLOCKFACE | \n",
" BROOKLYN | \n",
" NaN | \n",
" Precinct | \n",
" Open | \n",
" 10/31/2013 08:30:36 AM | \n",
" NaN | \n",
" 18 BROOKLYN | \n",
" BROOKLYN | \n",
" 1008937 | \n",
" 170310 | \n",
" Unspecified | \n",
" BROOKLYN | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" N | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 40.634104 | \n",
" -73.911055 | \n",
" (40.634103775951736, -73.91105541883589) | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Unique Key Created Date Closed Date Agency Agency Name Complaint Type Descriptor Location Type Incident Zip Incident Address Street Name Cross Street 1 Cross Street 2 Intersection Street 1 Intersection Street 2 Address Type City Landmark Facility Type Status Due Date Resolution Action Updated Date Community Board Borough X Coordinate (State Plane) Y Coordinate (State Plane) Park Facility Name Park Borough School Name School Number School Region School Code School Phone Number School Address School City School State School Zip School Not Found School or Citywide Complaint Vehicle Type Taxi Company Borough Taxi Pick Up Location Bridge Highway Name Bridge Highway Direction Road Ramp Bridge Highway Segment Garage Lot Name Ferry Direction Ferry Terminal Name Latitude Longitude Location\n",
"0 26589651 10/31/2013 02:08:41 AM NaN NYPD New York City Police Department Noise - Street/Sidewalk Loud Talking Street/Sidewalk 11432 90-03 169 STREET 169 STREET 90 AVENUE 91 AVENUE NaN NaN ADDRESS JAMAICA NaN Precinct Assigned 10/31/2013 10:08:41 AM 10/31/2013 02:35:17 AM 12 QUEENS QUEENS 1042027 197389 Unspecified QUEENS Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified N NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 40.708275 -73.791604 (40.70827532593202, -73.79160395779721)\n",
"16 26594086 10/31/2013 12:54:03 AM 10/31/2013 02:16:39 AM NYPD New York City Police Department Noise - Street/Sidewalk Loud Music/Party Street/Sidewalk 10310 173 CAMPBELL AVENUE CAMPBELL AVENUE HENDERSON AVENUE WINEGAR LANE NaN NaN ADDRESS STATEN ISLAND NaN Precinct Closed 10/31/2013 08:54:03 AM 10/31/2013 02:07:14 AM 01 STATEN ISLAND STATEN ISLAND 952013 171076 Unspecified STATEN ISLAND Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified N NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 40.636182 -74.116150 (40.63618202176914, -74.1161500428337)\n",
"25 26591573 10/31/2013 12:35:18 AM 10/31/2013 02:41:35 AM NYPD New York City Police Department Noise - Street/Sidewalk Loud Talking Street/Sidewalk 10312 24 PRINCETON LANE PRINCETON LANE HAMPTON GREEN DEAD END NaN NaN ADDRESS STATEN ISLAND NaN Precinct Closed 10/31/2013 08:35:18 AM 10/31/2013 01:45:17 AM 03 STATEN ISLAND STATEN ISLAND 929577 140964 Unspecified STATEN ISLAND Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified N NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 40.553421 -74.196743 (40.55342078716953, -74.19674315017886)\n",
"28 26594085 10/31/2013 12:32:08 AM NaN NYPD New York City Police Department Noise - Street/Sidewalk Loud Talking Street/Sidewalk 10026 121 WEST 116 STREET WEST 116 STREET LENOX AVENUE 7 AVENUE NaN NaN ADDRESS NEW YORK NaN Precinct Assigned 10/31/2013 08:32:08 AM 10/31/2013 02:00:57 AM 10 MANHATTAN MANHATTAN 997947 231613 Unspecified MANHATTAN Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified N NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 40.802390 -73.950526 (40.80238950799943, -73.95052644123253)\n",
"31 26595564 10/31/2013 12:30:36 AM NaN NYPD New York City Police Department Noise - Street/Sidewalk Loud Music/Party Street/Sidewalk 11236 AVENUE J AVENUE J EAST 80 STREET EAST 81 STREET NaN NaN BLOCKFACE BROOKLYN NaN Precinct Open 10/31/2013 08:30:36 AM NaN 18 BROOKLYN BROOKLYN 1008937 170310 Unspecified BROOKLYN Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified N NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 40.634104 -73.911055 (40.634103775951736, -73.91105541883589)"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"noise_complaints[: 5]"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"is_noise = complaints['Complaint Type'] == 'Noise - Street/Sidewalk'"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"0 True\n",
"1 False\n",
"2 False\n",
"3 False\n",
"4 False\n",
"Name: Complaint Type, dtype: bool"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"is_noise[: 5]"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"in_brooklyn = complaints['Borough'] == 'BROOKLYN'"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"0 False\n",
"1 False\n",
"2 False\n",
"3 False\n",
"4 False\n",
"Name: Borough, dtype: bool"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"in_brooklyn[: 5]"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Unique Key | \n",
" Created Date | \n",
" Closed Date | \n",
" Agency | \n",
" Agency Name | \n",
" Complaint Type | \n",
" Descriptor | \n",
" Location Type | \n",
" Incident Zip | \n",
" Incident Address | \n",
" Street Name | \n",
" Cross Street 1 | \n",
" Cross Street 2 | \n",
" Intersection Street 1 | \n",
" Intersection Street 2 | \n",
" Address Type | \n",
" City | \n",
" Landmark | \n",
" Facility Type | \n",
" Status | \n",
" Due Date | \n",
" Resolution Action Updated Date | \n",
" Community Board | \n",
" Borough | \n",
" X Coordinate (State Plane) | \n",
" Y Coordinate (State Plane) | \n",
" Park Facility Name | \n",
" Park Borough | \n",
" School Name | \n",
" School Number | \n",
" School Region | \n",
" School Code | \n",
" School Phone Number | \n",
" School Address | \n",
" School City | \n",
" School State | \n",
" School Zip | \n",
" School Not Found | \n",
" School or Citywide Complaint | \n",
" Vehicle Type | \n",
" Taxi Company Borough | \n",
" Taxi Pick Up Location | \n",
" Bridge Highway Name | \n",
" Bridge Highway Direction | \n",
" Road Ramp | \n",
" Bridge Highway Segment | \n",
" Garage Lot Name | \n",
" Ferry Direction | \n",
" Ferry Terminal Name | \n",
" Latitude | \n",
" Longitude | \n",
" Location | \n",
"
\n",
" \n",
" \n",
" \n",
" | 31 | \n",
" 26595564 | \n",
" 10/31/2013 12:30:36 AM | \n",
" NaN | \n",
" NYPD | \n",
" New York City Police Department | \n",
" Noise - Street/Sidewalk | \n",
" Loud Music/Party | \n",
" Street/Sidewalk | \n",
" 11236 | \n",
" AVENUE J | \n",
" AVENUE J | \n",
" EAST 80 STREET | \n",
" EAST 81 STREET | \n",
" NaN | \n",
" NaN | \n",
" BLOCKFACE | \n",
" BROOKLYN | \n",
" NaN | \n",
" Precinct | \n",
" Open | \n",
" 10/31/2013 08:30:36 AM | \n",
" NaN | \n",
" 18 BROOKLYN | \n",
" BROOKLYN | \n",
" 1008937 | \n",
" 170310 | \n",
" Unspecified | \n",
" BROOKLYN | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" N | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 40.634104 | \n",
" -73.911055 | \n",
" (40.634103775951736, -73.91105541883589) | \n",
"
\n",
" \n",
" | 49 | \n",
" 26595553 | \n",
" 10/31/2013 12:05:10 AM | \n",
" 10/31/2013 02:43:43 AM | \n",
" NYPD | \n",
" New York City Police Department | \n",
" Noise - Street/Sidewalk | \n",
" Loud Talking | \n",
" Street/Sidewalk | \n",
" 11225 | \n",
" 25 LEFFERTS AVENUE | \n",
" LEFFERTS AVENUE | \n",
" WASHINGTON AVENUE | \n",
" BEDFORD AVENUE | \n",
" NaN | \n",
" NaN | \n",
" ADDRESS | \n",
" BROOKLYN | \n",
" NaN | \n",
" Precinct | \n",
" Closed | \n",
" 10/31/2013 08:05:10 AM | \n",
" 10/31/2013 01:29:29 AM | \n",
" 09 BROOKLYN | \n",
" BROOKLYN | \n",
" 995366 | \n",
" 180388 | \n",
" Unspecified | \n",
" BROOKLYN | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" N | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 40.661793 | \n",
" -73.959934 | \n",
" (40.6617931276793, -73.95993363978067) | \n",
"
\n",
" \n",
" | 109 | \n",
" 26594653 | \n",
" 10/30/2013 11:26:32 PM | \n",
" 10/31/2013 12:18:54 AM | \n",
" NYPD | \n",
" New York City Police Department | \n",
" Noise - Street/Sidewalk | \n",
" Loud Music/Party | \n",
" Street/Sidewalk | \n",
" 11222 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" DOBBIN STREET | \n",
" NORMAN STREET | \n",
" INTERSECTION | \n",
" BROOKLYN | \n",
" NaN | \n",
" Precinct | \n",
" Closed | \n",
" 10/31/2013 07:26:32 AM | \n",
" 10/31/2013 12:18:54 AM | \n",
" 01 BROOKLYN | \n",
" BROOKLYN | \n",
" 996925 | \n",
" 203271 | \n",
" Unspecified | \n",
" BROOKLYN | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" N | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 40.724600 | \n",
" -73.954271 | \n",
" (40.724599563793525, -73.95427134534344) | \n",
"
\n",
" \n",
" | 236 | \n",
" 26591992 | \n",
" 10/30/2013 10:02:58 PM | \n",
" 10/30/2013 10:23:20 PM | \n",
" NYPD | \n",
" New York City Police Department | \n",
" Noise - Street/Sidewalk | \n",
" Loud Talking | \n",
" Street/Sidewalk | \n",
" 11218 | \n",
" DITMAS AVENUE | \n",
" DITMAS AVENUE | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" LATLONG | \n",
" BROOKLYN | \n",
" NaN | \n",
" Precinct | \n",
" Closed | \n",
" 10/31/2013 06:02:58 AM | \n",
" 10/30/2013 10:23:20 PM | \n",
" 01 BROOKLYN | \n",
" BROOKLYN | \n",
" 991895 | \n",
" 171051 | \n",
" Unspecified | \n",
" BROOKLYN | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" N | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 40.636169 | \n",
" -73.972455 | \n",
" (40.63616876563881, -73.97245504682485) | \n",
"
\n",
" \n",
" | 370 | \n",
" 26594167 | \n",
" 10/30/2013 08:38:25 PM | \n",
" 10/30/2013 10:26:28 PM | \n",
" NYPD | \n",
" New York City Police Department | \n",
" Noise - Street/Sidewalk | \n",
" Loud Music/Party | \n",
" Street/Sidewalk | \n",
" 11218 | \n",
" 126 BEVERLY ROAD | \n",
" BEVERLY ROAD | \n",
" CHURCH AVENUE | \n",
" EAST 2 STREET | \n",
" NaN | \n",
" NaN | \n",
" ADDRESS | \n",
" BROOKLYN | \n",
" NaN | \n",
" Precinct | \n",
" Closed | \n",
" 10/31/2013 04:38:25 AM | \n",
" 10/30/2013 10:26:28 PM | \n",
" 12 BROOKLYN | \n",
" BROOKLYN | \n",
" 990144 | \n",
" 173511 | \n",
" Unspecified | \n",
" BROOKLYN | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" Unspecified | \n",
" N | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 40.642922 | \n",
" -73.978762 | \n",
" (40.6429222774404, -73.97876175474585) | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Unique Key Created Date Closed Date Agency Agency Name Complaint Type Descriptor Location Type Incident Zip Incident Address Street Name Cross Street 1 Cross Street 2 Intersection Street 1 Intersection Street 2 Address Type City Landmark Facility Type Status Due Date Resolution Action Updated Date Community Board Borough X Coordinate (State Plane) Y Coordinate (State Plane) Park Facility Name Park Borough School Name School Number School Region School Code School Phone Number School Address School City School State School Zip School Not Found School or Citywide Complaint Vehicle Type Taxi Company Borough Taxi Pick Up Location Bridge Highway Name Bridge Highway Direction Road Ramp Bridge Highway Segment Garage Lot Name Ferry Direction Ferry Terminal Name Latitude Longitude Location\n",
"31 26595564 10/31/2013 12:30:36 AM NaN NYPD New York City Police Department Noise - Street/Sidewalk Loud Music/Party Street/Sidewalk 11236 AVENUE J AVENUE J EAST 80 STREET EAST 81 STREET NaN NaN BLOCKFACE BROOKLYN NaN Precinct Open 10/31/2013 08:30:36 AM NaN 18 BROOKLYN BROOKLYN 1008937 170310 Unspecified BROOKLYN Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified N NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 40.634104 -73.911055 (40.634103775951736, -73.91105541883589)\n",
"49 26595553 10/31/2013 12:05:10 AM 10/31/2013 02:43:43 AM NYPD New York City Police Department Noise - Street/Sidewalk Loud Talking Street/Sidewalk 11225 25 LEFFERTS AVENUE LEFFERTS AVENUE WASHINGTON AVENUE BEDFORD AVENUE NaN NaN ADDRESS BROOKLYN NaN Precinct Closed 10/31/2013 08:05:10 AM 10/31/2013 01:29:29 AM 09 BROOKLYN BROOKLYN 995366 180388 Unspecified BROOKLYN Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified N NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 40.661793 -73.959934 (40.6617931276793, -73.95993363978067)\n",
"109 26594653 10/30/2013 11:26:32 PM 10/31/2013 12:18:54 AM NYPD New York City Police Department Noise - Street/Sidewalk Loud Music/Party Street/Sidewalk 11222 NaN NaN NaN NaN DOBBIN STREET NORMAN STREET INTERSECTION BROOKLYN NaN Precinct Closed 10/31/2013 07:26:32 AM 10/31/2013 12:18:54 AM 01 BROOKLYN BROOKLYN 996925 203271 Unspecified BROOKLYN Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified N NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 40.724600 -73.954271 (40.724599563793525, -73.95427134534344)\n",
"236 26591992 10/30/2013 10:02:58 PM 10/30/2013 10:23:20 PM NYPD New York City Police Department Noise - Street/Sidewalk Loud Talking Street/Sidewalk 11218 DITMAS AVENUE DITMAS AVENUE NaN NaN NaN NaN LATLONG BROOKLYN NaN Precinct Closed 10/31/2013 06:02:58 AM 10/30/2013 10:23:20 PM 01 BROOKLYN BROOKLYN 991895 171051 Unspecified BROOKLYN Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified N NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 40.636169 -73.972455 (40.63616876563881, -73.97245504682485)\n",
"370 26594167 10/30/2013 08:38:25 PM 10/30/2013 10:26:28 PM NYPD New York City Police Department Noise - Street/Sidewalk Loud Music/Party Street/Sidewalk 11218 126 BEVERLY ROAD BEVERLY ROAD CHURCH AVENUE EAST 2 STREET NaN NaN ADDRESS BROOKLYN NaN Precinct Closed 10/31/2013 04:38:25 AM 10/30/2013 10:26:28 PM 12 BROOKLYN BROOKLYN 990144 173511 Unspecified BROOKLYN Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified Unspecified N NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 40.642922 -73.978762 (40.6429222774404, -73.97876175474585)"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"complaints[is_noise & in_brooklyn][: 5]"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Complaint Type | \n",
" Borough | \n",
" Created Date | \n",
" Descriptor | \n",
"
\n",
" \n",
" \n",
" \n",
" | 31 | \n",
" Noise - Street/Sidewalk | \n",
" BROOKLYN | \n",
" 10/31/2013 12:30:36 AM | \n",
" Loud Music/Party | \n",
"
\n",
" \n",
" | 49 | \n",
" Noise - Street/Sidewalk | \n",
" BROOKLYN | \n",
" 10/31/2013 12:05:10 AM | \n",
" Loud Talking | \n",
"
\n",
" \n",
" | 109 | \n",
" Noise - Street/Sidewalk | \n",
" BROOKLYN | \n",
" 10/30/2013 11:26:32 PM | \n",
" Loud Music/Party | \n",
"
\n",
" \n",
" | 236 | \n",
" Noise - Street/Sidewalk | \n",
" BROOKLYN | \n",
" 10/30/2013 10:02:58 PM | \n",
" Loud Talking | \n",
"
\n",
" \n",
" | 370 | \n",
" Noise - Street/Sidewalk | \n",
" BROOKLYN | \n",
" 10/30/2013 08:38:25 PM | \n",
" Loud Music/Party | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Complaint Type Borough Created Date Descriptor\n",
"31 Noise - Street/Sidewalk BROOKLYN 10/31/2013 12:30:36 AM Loud Music/Party\n",
"49 Noise - Street/Sidewalk BROOKLYN 10/31/2013 12:05:10 AM Loud Talking\n",
"109 Noise - Street/Sidewalk BROOKLYN 10/30/2013 11:26:32 PM Loud Music/Party\n",
"236 Noise - Street/Sidewalk BROOKLYN 10/30/2013 10:02:58 PM Loud Talking\n",
"370 Noise - Street/Sidewalk BROOKLYN 10/30/2013 08:38:25 PM Loud Music/Party"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"complaints[is_noise & in_brooklyn][['Complaint Type', 'Borough', 'Created Date', 'Descriptor']][0: 5]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 3.2 A digression about numpy arrays"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"0 1\n",
"1 2\n",
"2 3\n",
"dtype: int64"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"pd.Series([1, 2, 3])"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"array([1, 2, 3])"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.array([1, 2, 3])"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"array([1, 2, 3])"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"pd.Series([1, 2, 3]).values"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"arr = np.array([1, 2, 3])"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"array([ True, False, True], dtype=bool)"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"arr != 2"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"array([1, 3])"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"arr[arr != 2]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 3.3 which borough has the most noise complaints?"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"is_noise = complaints['Complaint Type'] == 'Noise - Street/Sidewalk'"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"noise_complaints = complaints[is_noise]"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"MANHATTAN 917\n",
"BROOKLYN 456\n",
"BRONX 292\n",
"QUEENS 226\n",
"STATEN ISLAND 36\n",
"Unspecified 1\n",
"Name: Borough, dtype: int64"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"noise_complaints['Borough'].value_counts()"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"noise_coplaints_counts = noise_complaints['Borough'].value_counts()\n",
"complaints_counts = complaints['Borough'].value_counts()"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"MANHATTAN 917\n",
"BROOKLYN 456\n",
"BRONX 292\n",
"QUEENS 226\n",
"STATEN ISLAND 36\n",
"Unspecified 1\n",
"Name: Borough, dtype: int64"
]
},
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"noise_coplaints_counts"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"BROOKLYN 32890\n",
"MANHATTAN 24288\n",
"QUEENS 22281\n",
"BRONX 19686\n",
"Unspecified 7107\n",
"STATEN ISLAND 4817\n",
"Name: Borough, dtype: int64"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"complaints_counts"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"BRONX 0.014833\n",
"BROOKLYN 0.013864\n",
"MANHATTAN 0.037755\n",
"QUEENS 0.010143\n",
"STATEN ISLAND 0.007474\n",
"Unspecified 0.000141\n",
"Name: Borough, dtype: float64"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"noise_coplaints_counts/complaints_counts"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
""
]
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA3cAAAF9CAYAAACnN5FZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X+Q1Hd9P/DX/do7Nnd4xgjHkSaaVmMacmaosUqxRGdM\nUhwL2l7HVKcYIGSk1oo2ziSdG0S8ksRWEU1mlE7jNU1V6KSoHUziiHV0chATyxwQSUI0rXJ3VATC\nnksCd7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jVEoFGJ0dDQKhULU1dUlXRJVbqLr6p577rm4\n4447hLsyCXcAAJx1H/7wh2NsbCz27NkTO3bsiKeeeiq++MUvxvz58+PKK69MujxqRFNTU9Il1BTh\nDgCAl0RDQ0N0dXVFV1dXFIvFePzxx2PHjh3CHROa6LTMQqEQ7373uxOopjaZlgkAwFn3ne98J975\nzncmXQacU9z2HQCAs+6hhx5KugQ45zgtEwCAs+7QoUPxwAMPTPjctdde+zJXA+cG4Q4AgLOuvr4+\nWlpawhVA8PIR7gAAOOva29tjwYIFSZcB5xTX3AEAcNa97W1vS7oEOOeYlgkAAJACjtwBAHDWPfjg\ng+OPn3zyybj11lvjlltuid27dydYFaSbcAcAwFm3ffv2iIgoFotx3333xerVq2P16tWxefPmhCuD\n9DJQBQCAs+7EiRORz+ejv78/3vKWt0Rzc3NEPD9FE3hp+NcFAMBZ193dHb29vfHUU0/FH/7hH0ZE\nRKFQiNe85jXJFgYpZqAKAABACjhyBwAAkALCHQAAQAoIdwAAACkg3AEAAKSAcAcAAJAC/w/LQz4i\nOZF/mAAAAABJRU5ErkJggg==\n",
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"(noise_coplaints_counts/complaints_counts.astype(float)).plot(kind='bar')"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.11"
}
},
"nbformat": 4,
"nbformat_minor": 0
}