liveBook · Manning

Session count

As explained in The Well-Grounded Data Analyst

Session count is the number of recorded browsing sessions associated with a user or other entity.

Session count measures the number of recorded browsing sessions associated with each user. Used as a proxy for phone-use intensity, it adds a frequency dimension to user segmentation alongside app variety and session duration. section 12.5.2

user_metrics = (
    app_data_merged
    .groupby(["user_id"])
    .agg(
        number_of_apps=("app_name", "nunique"),
        number_of_sessions=("session_id", "nunique")
    )
    .reset_index()
)

user_metrics.head()

Counts distinct session identifiers per user and produces a user-level metric table for joining into segmentation data. section 12.5.2

How The Well-Grounded Data Analyst covers it

How deep it goes
Computes distinct session identifiers per user and stops short of discussing session-detection rules or statistical interpretation.
Examples
Demonstrates a grouped aggregation using user_id and session_id to calculate number_of_sessions.
What it assumes
Assumes user and session identifiers exist in app-level records and distinguishes sessions from unique apps.
What you can do after
Apply it via pandas to add per-user session frequency to a segmentation dataset.
How it connects
Connects session count with user-level datasets, user segmentation, unique app count, and session duration.

This explainer was generated by Manning's knowledge graph from the text of The Well-Grounded Data Analyst. The section links point to the parts of the book it draws on.