Mapping NYC's Restaurants Closed Due to COVID

New York City has lost nearly 650,000 jobs since the coronavirus pandemic came to the city roughly a year ago. Many, if not the majority, of those lost jobs were from the services and hospitality sectors: hotel workers, office cleaners, and — perhaps most notably — restaurant workers, among numerous others.

I’ve often said that New York is a city of neighborhoods and local bars and restaurants are often focal points of their communities (back when it was New Amsterdam, the city’s governing building was also a pub). So when a restaurant closes, the impact isn’t just felt by its workers and owners, but also its regular patrons and the neighborhood as a whole. What we’ve also seen over the course of this pandemic so far, though, is that not every neighborhood has had the same experiences — loss is not evenly distributed across space and time.

Last week, the news publication Patch NYC linked to this article giving a neighborhood-by-neighborhood breakdown of the restaurants that have closed across the five boroughs. What it didn’t include, though, was a map aggregating this information in a way that might be more digestible for a neighborhood-level (or event sub-neighborhood-level) analysis. As such, I took it upon myself to build that very map, giving a block-by-block breakdown of the restaurants the city has lost so far over the course of the pandemic. That map is just below, and interactive — so you can zoom, pan, and hover over the dots to see which restaurants they represent.

If you’re curious how I actually made the map, a quick breakdown of my methods can be found just past the map itself.

Methods & Materials/Data

To begin with, I needed to get the list of closed restaurants from The Infatuation. As much as I’d like to tell you I did some slick curl or wget action, I actually just copy-pasted the text from that part of the website and dropped it into an empty notepad file. From there, I removed the neighborhood names to clean up the input information (and yes, I also did that manually).

Once the restaurant list was set up, I read it in to a jupyter notebook as a pandas dataframe. At this point, that dataframe only had one column, which was the names of the restaurants. For plotting purposes, latitude and longitude is the way to go, so I initialized two more empty columns and set up a geocoding loop to query the Google Maps API with the names of each restaurant (taking care to emphasize that these were all restaurants in New York City). From that loop, I got the latitude and longitude for each restaurant on the list, adding that information to the dataframe.

From there, it was pretty easy to toss together an interactive map using Plotly (I did what any responsible coder/data scientist/developer/etc. would do and googled for something that looked like what I was trying to achieve). If you have any more specific questions about what I did, or would like to check out the data in any of its forms of refinement, feel free to send me a message.

Caveats and Limitations

Let’s begin by acknowledging that there is a very good chance the list I pulled from is not comprehensive. I can’t confirm, but I imagine the formal/zoning definition of a restaurant is different from our colloquial one, so there could very well be places in your neighborhood that you know have closed but didn’t show up on this list for a reason such as this. Additionally, I don’t think this list includes bars — establishments that only serve alcohol (or currently alcohol + Cuomo chips) — so I imagine many a local watering hole isn’t showing up on this list as well. Finally, even with a pretty specific geocoding query, a handful of establishments weren’t being identified as being in the city. With these queries being run against Google’s databases, if something new has already come along in those locations no search query, no matter how specific, will turn up the correct location. As always, you have two options when it comes to civic data: it can be clean and a little incomplete or comprehensive and messy. I put this all together in a day, so I’m not too upset with how it came out.