Deep floodwaters in Bangkok drove thousands of residents into shelters as others scrambled to buy groceries or dry out their homes on Sunday after days of heavy rain inundated markets, roads, and residences.