Distinct Buyers per Day
sales has columns day (text) and buyer (text). The same buyer can buy several times on a day. Return a dictionary mapping each day to the number of different buyers on that day.
Example 1
sales {"day":["mon","mon","tue"],"buyer":["ann","ann","ann"]}
returns {"mon":1,"tue":1}
Ann is one buyer on mon, one on tue.
Constraints
- The tables are small
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More pandas problems
- Duplicate EmailsEasy
- Email DomainsEasy
- Find Customer RefereeEasy
- First Login DateEasy
- Fix Name CapitalsEasy
- Grade LettersEasy
- Ids in Only One TableEasy
- InitialsEasy