← 返回 meta 的题目列表Python Data Processing: Merge two messy sources and compute a summary dictionary
类型:online_judge
Prompt
In Python project mode, you receive two data sources from different systems/teams (provided in code files; often as raw strings or lists/dicts). The data contains known issues explicitly listed in the README, such as:
Inconsistent event formats / missing fields
Invalid/corrupted records (must be skipped; your code must not crash)
Orphaned records between the two sources
Schema changes causing nulls or renamed fields
Implement the function signature specified in the README to:
Parse raw data into structured objects.
Handle bad data robustly (skip/default/log; but do not crash).
Merge the two sources using the required key/linking logic.
Compute aggregate metrics grouped by categories/dimensions.
Return a clean summary dictionary that directly answers the Section 1 business question.
Constraints
Handle all edge cases called out in the README.
The solution must run and match the expected sample output.
This tests real-world data wrangling, code readability, and edge-case handling.