The city’s rat race is real.

Geospatial analyst Vanessa Mateus used open-source 311 call data to create a new map showing the density of rodent populations across New York City. In her model, dark purple indicates more dense (10) areas, while yellow means less dense (1).

The map reveals Mott Haven in the South Bronx is the most rat-dense neighborhood in NYC, the only area to rank a 9 on the rodent spectrum. (No nabes merited a 10.) The most infested neighborhood in Brooklyn is Bed-Stuy (8), while Manhattan’s Upper East Side (7) and West Harlem (7) are tied.

Mateus designed the map because she wondered which areas were most infested — plus, she had some personal beef after some rats inflicted $850 in damage on her street-parked car. “One morning I was trying to turn it on, it wasn’t working, and I quickly realized there was something going on under the hood,” she recalls.

M&M Pest Control’s Timothy Wong, who has been in the rat-killing business for over 20 years, observes that the map may, in many swaths of the city, more accurately reflect locals’ rat tolerance than actual density.

“I think there are a lot of neighborhoods that have a lot of rats but not a lot of 311 complaints,” he says. “There are rats in almost every corner of certain neighborhoods, but people just don’t call 311 because they don’t speak the language or they find [rats] to be part of their daily lives living there. But as the neighborhoods are being gentrified, more people are saying, ‘Hey, I don’t want to see that.’”

The author of the 2004 hit book “Rats: Observations on the History & Habitat of the City’s Most Unwanted Inhabitants,” Robert Sullivan, agreed, telling The Post that the map’s rat-infested areas show “where the pressures of gentrification are at the moment most extreme.”

More broadly, neighborhoods with a high-density human population (which produces a lot of trash) and many construction sites (which often rip up rat burrows) contain more rat sightings, says NYC Pest Control’s Billy Swan.

Unfortunately, experts agree, pests are inevitable. “They are everywhere,” adds Swan. “You’re not getting rid of rats.”