Python
All Top 50 Python & Pandas Interview Questions#2
Clean and Filter Data with List Comprehensions in Python
EasyGoogleInterview Question #2
Asked at GoogleGiven a list of raw transaction descriptions, strip leading/trailing whitespace, uppercase the strings, and filter out any empty strings or strings starting with '#'.
Input Table: raw_strings
1 rows preview| input_list |
|---|
| salary credit , #internal_transfer ,BONUS,, |
Expected Output Structure1 rows
| output_list |
|---|
| SALARY CREDIT,BONUS |
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.