The Cafe Problem

Ragnar
6 min readJan 31, 2021

--

Nearly 30 years ago, Babu Bhatt opened an eclectic restaurant in an episode of Seinfeld. What if he were to open it today? Where would it succeed?

Babu Bhatt, entrepreneur.

In one of the most famous episodes of Seinfeld, we see Jerry become obsessed with a restauranteur named Babu Bhatt. Babu has opened an eclectic restaurant across the street from Jerry’s Upper West Side apartment, but has gotten no customers. Eventually, Jerry Seinfeld visits Babu in his restaurant and suggests that instead of running an eclectic restaurant with a wide variety of cuisines available, he open a restaurant that serves food from his native Pakistan. Babu loves this idea and calls Jerry a “very great man” for suggesting this idea.

After a brief shutdown for remodeling and a grand re-opening, unfortunately, Babu Bhatt has still not gotten any customers. When Jerry visits Babu again, Babu is upset with him and says that despite all of the time and money he has spent changing the restaurant, he still hasn’t been successful. Maybe Jerry isn’t such a great man after all!

At the end of this particular episode of Seinfeld, we see Babu loading up a truck and closing down the restaurant. Maybe the locals weren’t interested in a Pakistani restaurant? Maybe it was just a bad location? During the credits stand-up scene, Jerry says he thinks it has to do with location…so which neighborhood in NYC would have been better location for a Pakistani restaurant?

Neighborhoods:

We can take the data from this .json (https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-DS0701EN-SkillsNetwork/labs/newyork_data.json) and use it to fill a dataframe:

How we filled our data frame from the .json file

If we use the neighborhoods.head() function we get this result:

Neighborhoods.head() for our new data frame.

The dataframe looks great! Now, let’s create a map of NYC with our Neighborhoods superimposed on it as clusters:

Code for mapping the neighborhoods with stack.
The neighborhoods data frame stacked, showing Breezy Point.

If we zoom in and out of the map, the clusters stack on top of one another. As we can see above, only one neighborhood is not stacked at this zoom level: Breezy Point, Queens.

Pakistani Restaurants:

At this point, I thought it would be interesting to see where Jerry Seinfeld’s apartment was in relation to the current Pakistani restaurants in NYC. To do this, we leverage the Foursquare API to search for “Pakistan” and then filter out all non-restaurants. Creating a dataframe with that information looks like this:

The Pakistani restaurants that are currently in NYC.

As you can see, the Foursquare API tags some of these Pakistani restaurants incorrectly, so it took quite a bit of trial and error to ensure that only Pakistani restaurants were being returned and not Indian/Middle Eastern restaurants as well. Now that we have the correct list, let’s see what it looks like on our map with Jerry’s apartment as reference:

Jerry’s apartment is the blue pushpin, the red dots are existing Pakistani restaurants.

Where to Open a Restaurant:

If you would like to open a restaurant in a city, what factors would you consider when selecting a location? First and foremost, for me, would be the safety of the neighborhood. No one wants to spend time in an area with a high crime-rate, so let’s take a look at crime rates throughout NYC. We can get this data from here: https://data.cityofnewyork.us/api/views/5uac-w243/rows.csv?accessType=DOWNLOAD

Once we scrub the data and count incidents by precinct, we can put it into a nice, clean data frame shown here:

Using a .geojson file that maps out every NYPD precinct, we can use the Choropleth function of the Folium library to visually display the precincts with the most crime.

Credit to dwillis for providing the .geojson of NYPD precincts.
Choropleth map of crime in NYC by precinct.

As you can see from the map above, the highest number of crimes are committed in Precinct 75, located in Brooklyn. The other precincts with a high number of crimes are in Queens and the Bronx. We won’t want to open a new, trendy restaurant in one of these neighborhoods if we hope to be successful.

Where Are New Restaurants Opening?

Hotspots in a city are often characterized by the amount of new businesses opening there, so I downloaded a database of all active business licenses granted by the city of New York. With a little bit of scrubbing, we had a data frame that contained only active licenses for sidewalk cafes granted since 1 Jan. 2019.

The first five listings from our data frame.

I decided to filter out everything but licenses for “Sidewalk Cafes” because in my mind, these are the trendiest kind of restaurant around. If the only seating is inside the restaurant, maybe the surrounding area isn’t that spectacular? Additionally, since the Coronavirus has taken a toll on us all, when I searched for “Sidewalk Cafes” that have opened since 1 Jan. 2020, I only had six results! Nevertheless, I imagine that up and coming areas from 2019 are still going to be considered up and coming in 2021.

Let’s check out our new Sidewalk Cafes on a map:

Newly-opened Sidewalk Cafes in NYC since 1 Jan. 2019.

Let’s take a look at the Choropleth map of crime compared to our newly-opened sidewalk cafes:

The location of every new sidewalk-cafe in NYC.

Putting It All Together:

As you can see, there are a few concentrated clusters of new sidewalk-cafes that have been opened in NYC over the past year or two, but let’s see how those clusters compare to the Pakistani restaurants in the area:

I’ve zoomed in considerably in order to highlight Pakistani restaurants (flames) near new restaurant openings.

Though you cannot tell from the above image, there are actually four Pakistani restaurants seen here (as the southern-most pushpin is actually two stacked very closely together).

If I were to open a restaurant, I would want to place it in a location without much competition. Therefore, let’s look at clusters that are away from existing Pakistani restaurants by neighborhood:

The cluster with the highest density of new sidewalk cafes that is also separated from other Pakistani restaurants is located in the Upper West Side of Manhattan. Wait….

As you can see, there is a tight cluster of sidewalk cafes that have opened in the Upper West Side of Manhattan over the past two years. Additionally, they are relatively far away from other Pakistani restaurants already open in NYC. What about crime rates? Is that a good location?

Jerry’s apartment is the blue pushpin.

As we can see above, between crime rates, existing locations of Pakistani restaurants, and new sidewalk cafe openings, the best location in NYC is the Upper West Side of Manhattan…incidentally, exactly where Babu Bhatt opened his restaurant 30 years ago in that episode of Seinfeld. We can even confirm this by looking at the blue pushpin showing Jerry’s apartment at 129 West 81st St., New York, NY.

Other good locations for a Pakistani sidewalk cafe could be in Northside, Brooklyn, or West Village, Manhattan…but I’d personally stick with what the data is showing and put it exactly where it should have always been — the Upper West Side.

Thank you!

--

--