Drills tagged with this skill, unpassed first. Pass them all to mark the skill ready for scenarios.
price as floats so you can add them up.
Your task. Write prices_as_float(df) that returns the price column as a Series of floats.
Example. ["10.5", "20"] → [10.5, 20.0].
Notes. Use .astype() to convert dtype. Empty input → empty Series." alice ", "BOB"); clean each to a consistent format.
Your task. Write clean_names(df) that returns the name column with each value stripped of surrounding whitespace and converted to title case.
Example. " alice " → "Alice". "BOB" → "Bob". " JANE doe" → "Jane Doe".
Notes. Use .apply() to run a function across the column. Empty df → empty Series."US", "UK", "IN") but the final report needs full names.
Your task. Write expand_country_codes(df, mapping) that returns the country column with each code replaced by its full name from the mapping dict.
Example. codes ["US", "IN"], mapping {"US": "United States", "IN": "India"} → ["United States", "India"].
Notes. Codes not in the mapping are left unchanged. Empty mapping → all codes pass through unchanged.