Introduction

I lived in the Gowanus neighborhood of Brooklyn before the Whole Foods and before the Kentile Floors sign came down. Today, on the eve of an environmental clean up from the EPA\cite{history}, the neighborhood is rapidly gentrifying. The changes in the built environment are quite striking. In addition to construction introducing new housing stock, the neighborhood is investing in green space, making efforts to beautify the Superfund site. With so much change, arguably good and bad, I'm interested in how the neighborhood has voiced their concerns over time.
311 is the non-emergency call system that allows citizens to report issues in their neighborhood. Since its origin, it's been a quick snapshot of a region's pulse. Specifically, noise complaints have been used as one proxy to help understand gentrification. It speaks to the increase in people/parties, but also to those who use the call line to report noise: those who are potentially less familiar with the baseline sounds of the neighborhood.\cite{gentrification}
By looking at noise complaints in 311 data from 2010 - 2017, I hope to identify how — if at all — complaints in Gowanus deviate from Brooklyn's overall distribution. What can this data-driven story tell us how when the neighborhood changed, and what does the trend mean for the future of my favorite Brooklyn neighborhood? 

The data 

The 311 dataset is available on OpenDataNYC from 2010 to present\cite{data}. I worked with data from Brooklyn only, and filtered to the four distinct types of noise complaints include:
Filtering using these complaint types, I was left with 664,116 calls over the years to work with. 

Isolating Gowanus

Identifying calls that took place in Gowanus required some data munging. The location designations available in the 311 dataset is not granular enough to look at the neighborhood on its own. If we were to look at Community Board 6, for example, we could work with Gowanus data, but it would also contain information about Park Slope, which would contaminate our analysis.
First,  I combined the lat and long provided in each call, and used the shapely package to convert them to the appropriate geometry, and to a geodataframe. This ensured that the lat/longs were meaningful, tied to a real geographic projection.
brooklyn['lonlat'] = zip(brooklyn['Longitude'], brooklyn['Latitude'])
brooklyn['geometry'] = brooklyn[['lonlat']].applymap(lambda x:shapely.geometry.Point(x))
geometry = brooklyn.geometry
crs = {'init': 'epsg:4326'}
brooklyn = GeoDataFrame(brooklyn, crs=crs, geometry=geometry)
Next, I created a polygon for Gowanus, latitude and longitude points that I picked to identify my neighborhood of interest. From there, I used a for loop with the contains() function to ask if each of the recorded calls' location fell within the area I'd identified as Gowanus, which resulted in a boolean array. I added the array to the dataframe as a column, and used it to create a new dataframe where:  gowanus = brooklyn[brooklyn['is_gowanus'] == True]
At the end of this spatial analysis exercise, my Gowanus dataframe had 7,262 rows.

Cleaning and new features

The key columns from the larger 311 dataset include features like location data, unique keys, and descriptors for each complaint type. Outside of the geometry data I created in order to isolate calls in the neighborhood, I created new datetime columns for year and month (for easier groupings in the analysis).

Exploratory analysis

I grouped data by year and complaint type in order to visualize the data over time. The plots below show how Brooklyn and Gowanus complaints have evolved.