Normalizing Transit Payment Data
A transit system collects payment data from multiple stations. Different stations use different text strings to record when a passenger pays with a mobile app. The raw data contains the following strings for mobile payments: “App”, “Mobile”, “app”, “Smartphone”, and “MOBILE”.
A programmer is writing a script to clean the data so that all mobile payments are recorded as “Mobile_App” before generating a revenue report.
Which of the following describes the most appropriate way to normalize this data without changing its meaning?
Replace any string that contains the letter ‘p’ or ‘m’ (case-insensitive) with “Mobile_App”.
Delete all records containing “App”, “app”, “Smartphone”, or “MOBILE” and only keep records containing “Mobile”.
Check if the string is exactly equal to “App”, “Mobile”, “app”, “Smartphone”, or “MOBILE”, and if so, replace it with “Mobile_App”.
Convert all strings in the dataset to uppercase, then replace any string longer than 3 characters with “Mobile_App”.
Question Leaderboard
Not enough data yet to show leaderboard.
