liveBook · Manning

Customer activity rate

As explained in Effective Data Analysis

Customer activity rate is the proportion of a defined period during which a customer performs a specified activity.

Customer activity rate measures the share of days in a defined period when a customer performs a specified activity. For monthly logins, divide login days by the number of days in that month. section 7.2.2

Use the metric to investigate:

  • Overall distributions: most customers are active on 25%–75% of monthly days, while very few exceed 80% or fall below 20%. section 7.2.2
  • Segment differences: regional distributions can justify separate baselines, targets, and tracking. section 7.2.2
  • Time patterns: compare regions across years and investigate possible seasonality, while verifying apparent changes with relevant teams. section 7.2.2
logins["n_days"] = logins["month"].dt.days_in_month     #1
logins["login_days_pct"] = logins["login_days"]/logins["n_days"]     #2

sns.histplot(x=logins["login_days_pct"], bins=32)    #3
plt.title("Distribution of the % of Days Active Per Month")
plt.xlabel("% of Days Active")
plt.ylabel("# of Records")

Computes monthly active-day percentages and visualizes their distribution with a histogram. section 7.2.2

avg_logins = (   #1
    logins.groupby(["month", "region"])["login_days_pct"].mean().reset_index()
)

sns.lineplot(x="month",     #2
y="login_days_pct", 
hue= "region", 
data=avg_logins)
plt.xlabel("Month")
plt.ylabel("Avg. % Days Active")
plt.title("Average % of Monthly Active Days Over Time")

Aggregates customer activity by month and region to compare average rates over time. section 7.2.2

How Effective Data Analysis covers it

How deep it goes
Explains calculation, distributions, regional segmentation, multiyear trends, and seasonality, but defers causal validation.
Examples
Uses monthly login days, regional histograms, three-year trend lines, and month-by-year comparisons.
What it assumes
Assumes customer-level activity records with dates and segments, while demonstrating monthly day-count normalization.
What you can do after
Apply it via pandas and seaborn to calculate, visualize, segment, and monitor monthly activity rates.
How it connects
Connects customer activity rate to baselines, targets, segmentation, time series, and seasonality.

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