Merge dataframes

In the last exercise, you built a dataset of the top 100 cafes in New York City according to Yelp. Now, you'll combine that with demographic data to investigate which neighborhood has the most good cafes per capita.

To do this, you'll merge two datasets with the DataFrame merge() method. The first,crosswalk, is a crosswalk between ZIP codes and Public Use Micro Data Sample Areas (PUMAs), which are aggregates of census tracts and correspond roughly to NYC neighborhoods. Then, you'll merge in pop_data, which contains 2016 population estimates for each PUMA.

pandas (as pd) has been imported, as has the cafes dataframe from last exercise.

This exercise is part of the course

Streamlined Data Ingestion with pandas

View Course

Hands-on interactive exercise

Turn theory into action with one of our interactive exercises

Start Exercise