The Unofficial NYC Subway Rat Census

Hi, it’s Ivan, I work on Datawrapper’s visualization team. This week we’re taking a trip to New York City to find out which subway stations are particularly popular with rats.

After recently stumbling upon a dataset of rat sightings in the New York subway system, I decided to continue our unofficial series on rodent life in the Big Apple (following from “The 2018 Central Park Squirrel Census,” by my colleague Rose). This time we’re diving underground — and sometimes overground — to compare rat populations at different subway stations.

The data comes from user reports from the Transit app and should be taken with a grain of salt, as there is no indication of how many people have made these reports. The report categories are also rather subjective: The difference between “So many” and “One or two” is not always clear cut when it comes to rats, and judgement will vary from person to person.

Obtaining data

Getting the data for this map proved quite challenging. Although it’s possible to download a CSV directly from Transit, for some reason (at the time of writing) the CSV did not have the correct sighting values, so I had to scrape this data directly from their website instead. Thankfully the full table with all correct values is there.

Another challenge was that the data from Transit does not include latitude and longitude coordinates, which are required to map the stations. Although station names are included in the dataset, the names alone are insufficient to correctly geocode stations. That’s because New York has many stations with the same names; for example, there are six stations called “86th Street” 😏. I had to combine my rat sightings dataset with an official dataset from the Metropolitan Transportation Authority containing latitude and longitude coordinates to correctly map the stations.


When I last visited NYC, I personally didn’t see many rats in the subway. But maybe I just didn’t visit the right stations! That’s it from me, let me know if you have any comments at ivan@datawrapper.de. We’ll see you next week!

Comments