Python
#2

Clean and Filter Data with List Comprehensions in Python

EasyGoogle
Interview Question #2
Asked at Google

Given 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.

Chat with us