We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Active Users

DAU, WAU, and MAU – daily, weekly, and monthly active users – are the most watched metrics at most product companies. An active user is a unique user who performed at least one "qualifying event" in a time window. These metrics answer the important question: how many people are actually using this thing?

At Boot.dev, we use "lesson submissions" as our "qualifying event." So a "daily active user" is someone who attempted to submit at least one lesson on a given day.

You can count distinct values in each group using nunique(). It ignores duplicates, so repeated values don't inflate the numbers:

unique_devices = events.groupby("event_type")["device_id"].nunique()

This groups events by event_type, then counts how many distinct device_ids appeared in each group. For active-user metrics, the value you count is usually a user ID, and the group is usually a time bucket like a day, week, or month.

DAU/MAU ratio is often used as a product "health check." A ratio above 0.5 means people use your product on most days of the month (like a messaging app). Below 0.1 means it's a monthly-visit product (like a billing portal). Neither is inherently bad – it depends on your product.

Assignment

SnackStack's product team wants to know how many people actually use the app each day.

Complete the calculate_dau function. It accepts an events DataFrame with timestamp and user_id columns and returns a DataFrame with one row per calendar date: a date column and an active_users count.