# Turning Text into Numbers: to_numeric

Text such as '59 lbs' and '$75' becomes numbers in two steps, .str.replace to take off the units and symbols, then pd.to_numeric with errors='coerce' to convert what's left, followed by a list of the values that became missing so none is lost silently.

![Cheat sheet: Turning Text into Numbers: to_numeric](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/c8fc6504a14e48859225fbaf84bc0108.webp)

- Category: Data Analysis
- Level: Apprentice
- Tags: python, str.replace(), to_numeric(), Type Conversion (python)
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/pandas-text-to-numbers-cheat-sheet
