Python
All Top 50 Python & Pandas Interview Questions#24
Convert Formatted Currency Strings to Floats in Pandas
EasyInterview Question #24
Given a column with messy strings like `['$1,250.50', ' ₹ 4,999.00 ', ' $800 ' ]`, clean the column and convert it into a pure `float64` Series.
Input Table: prices
2 rows preview| raw_price |
|---|
| $1,250.50 |
| ₹ 4,999.00 |
Expected Output Structure2 rows
| clean_price |
|---|
| 1250.5 |
| 4999 |
Interview Context
Asked frequently in data analyst and business analyst technical rounds. Focus on clean filtering, optimal indexing usage, and unambiguous column selection.
Python 3.10 (Pandas)
Environment Ready
Click "Run & Test" to execute your Pandas code against the test assertions.