Back to problems

Find top category by video time spent

Algorithm · Pinterest · Medium

Use pandas for this challenge. You are given a pandas DataFrame df containing one row per pin interaction. Its columns are: user_id (int) pin_id (int) pin_type (str) category (str or None) time_spent_sec (numeric) A second input, category_map, is a dictionary mapping normalized category keys to canonical category names. A row is considered a video pin only when the lowercase form of pin_type is either "video" or "vedio"; the misspelling "vedio" should be treated as "video"…

Checking your access…