The Column Transformer
A easy Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- easy
- Seniority
- L3
Problem
An ETL step ships its per-column transforms as configuration: `transforms` maps a column name to a string of Python lambda source such as `'lambda x: x.upper()'`, while `rows` is a list of same-keyed dicts. Turn each source string into a callable and apply it to that column's value in every row, returning new rows with the untransformed columns and each row's key order intact and the input rows left unmodified.
Summary
Each column gets its function.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.