For years, this brown-brick building near Wrigley Field housed people who had nowhere else to go. It had peeling walls and broken smoke detectors. But its tiny one-room apartments offered homes to residents too poor for a one-bedroom, too risky to pass a credit check, too vulnerable — on the perpetual edge of homelessness — to sign a one-year lease.

Today, from the outside, the building looks the same: six stories, with tall windows and an elaborately carved entryway that still announces the property by its pre-World War II name, the “Hotel Carlos.” But it now contains studios remodeled with stainless steel appliances, granite countertops and hardwood floors. Rent reaches $1,125 a month. The ad in the window promises “vintage charm.”

In buildings like this one on Chicago’s North Side, the shrinking pool of affordable housing — a problem facing many thriving cities — is playing out in a particularly vivid way. Often, gentrification displaces the poor through less direct means: Wealthier residents move in, businesses catering to them follow, property values rise, the economics of a neighborhood change, and longtime residents are priced out. But here — and in other former “single room occupancy” hotels in Chicago — the displacement is much more literal.