Lesson 28 · Real-World Data Analytics
Email Marketing Benchmarks in Python: Open & Click Rates | Data Analytics #28
Is your email open rate actually good? We analyse published email marketing benchmarks for 45 industries (from a report covering 3.6 million campaigns) in…
- CourseReal-World Data Analytics
- Lesson28 of 100
- Video17 min
- FormatJupyter notebook · 30 code cells
- Data1 dataset
What you'll learn
Datasets used in this lesson
Save these next to the notebook. In Google Colab, upload them with the 📁 icon on the left first.
📓 Full notebook
Download .ipynbData Analytics 100, Video 28: Email Marketing Performance Analysis#
- Video twenty-eight of the hundred-video real-world data analytics series.
- Real published email marketing benchmarks across forty-five real industries, from a real report covering 3.6 million real campaigns.
- Let's get into it.
This lesson is for marketers and analysts who need to judge whether an email campaign is doing well. A raw open rate of 35% sounds fine, but is it? The business question is how email engagement varies by industry, and how you can compare your own results against a fair yardstick.
The dataset, email_marketing_benchmarks_2026.csv, holds published benchmarks for 45 industries drawn from a report covering 3.6 million campaigns. Each row is one industry, with four percentage metrics: Open_Rate_Pct (share of recipients who opened), Click_Rate_Pct (share of recipients who clicked), Click_To_Open_Rate_Pct (share of openers who clicked, often called CTOR) and Unsubscribe_Rate_Pct.
In this lesson you will:
- rank industries on each metric and spot leaders and laggards
- use correlations to see which metrics measure different things
- filter with median thresholds, build a composite engagement score and write a reusable benchmarking function
By the end you will be able to place any campaign result in its industry context. You should be comfortable with sorting, boolean filtering and writing a simple Python function; see earlier lessons in the series if not.
Part 1: Real Benchmarks, Real Industries#
Benchmarks only help if you know exactly what you loaded. The code imports pandas and matplotlib, reads the benchmark CSV and checks .shape. The output (45, 5) confirms 45 industries and five columns: the industry name plus four rate metrics. Because each row is already an industry average rather than an individual campaign, every result in this lesson describes industries, not single emails. Keep that in mind when interpreting correlations later.
import pandas as pd
import matplotlib.pyplot as plt
benchmarks = pd.read_csv('email_marketing_benchmarks_2026.csv')
benchmarks.shape
Part 2: Real Data Preview#
Summary statistics tell you what normal looks like before you rank anything. The code calls .head(5) and then .describe(), but only the last expression is displayed, so the output shows the summary table. The average open rate is 43.43%, while the average click rate is just 2.09%. CTOR averages 6.80% and unsubscribes only 0.22%. Open rates range from 30.10% to 55.71%, so an industry gap of around 25 points exists, which is why industry context matters.
benchmarks.head(5)
benchmarks.describe().round(2)
Part 3: Real Top Open Rate Industries#
Seeing who leads on open rate shows which audiences are most eager to read emails. The code sorts by Open_Rate_Pct with ascending=False, keeps the top ten with .head(10) and selects two columns using a list inside double brackets. The output shows Religion on top at 55.71%, then Hobbies (53.25%) and Non-profit (52.38%). Most leaders are community or passion-driven sectors such as art galleries and coaching, where subscribers have actively chosen to hear from the sender.
top_open_rate = benchmarks.sort_values('Open_Rate_Pct', ascending=False).head(10)
top_open_rate[['Industry', 'Open_Rate_Pct']]
Part 4: Real Bottom Open Rate Industries#
The bottom of the list is just as useful, especially if you work in one of these sectors. Sorting with the default ascending order puts the lowest open rates first. The output shows Travel and transportation lowest at 30.10%, followed by e-commerce (32.67%) and Publishing company (34.24%). Retail and several commercial sectors also appear. These are often high-volume promotional senders, so a 33% open rate in e-commerce may be perfectly healthy for that industry even though it looks weak overall.
bottom_open_rate = benchmarks.sort_values('Open_Rate_Pct').head(10)
bottom_open_rate[['Industry', 'Open_Rate_Pct']]
Part 5: Visualizing Real Open Rates#
A horizontal bar chart presents the top ten clearly, with room for long industry names. The code sorts again, draws bars with plt.barh, and uses plt.gca().invert_yaxis() so the highest open rate appears at the top. The figure is saved to top_open_rates.png and closed, so nothing displays here. When you open it, notice that the bars differ by only about 8 points from first to tenth, so the x-axis starting at zero keeps the comparison honest.
top10 = benchmarks.sort_values('Open_Rate_Pct', ascending=False).head(10)
plt.figure(figsize=(9, 6))
plt.barh(top10['Industry'], top10['Open_Rate_Pct'], color='steelblue')
plt.xlabel('Real Open Rate (%)')
plt.title('Real Top 10 Industries by Email Open Rate')
plt.gca().invert_yaxis()
plt.tight_layout()
plt.savefig('top_open_rates.png', dpi=120)
plt.close()
Part 6: Real Click Rate Leaders#
Opening an email is only the first step: a click is usually what the business really wants. The code sorts by Click_Rate_Pct and keeps the top ten. The output shows Legal leading at 4.90%, then Manufacturing (4.22%) and Media (4.10%). This list is quite different from the open-rate leaders. Manufacturing was in the bottom ten for opens at 37.36% yet ranks second for clicks, a first hint that opens and clicks behave differently.
top_click_rate = benchmarks.sort_values('Click_Rate_Pct', ascending=False).head(10)
top_click_rate[['Industry', 'Click_Rate_Pct']]
Part 7: Real Open Rate vs Click Rate, Are They Related?#
If open and click rates moved together, you could track just one. .corr() computes the Pearson correlation, a number from -1 to 1 that measures how closely two variables follow a straight-line relationship. The output is 0.176, a weak positive relationship. Industries with higher open rates only slightly tend to have higher click rates. In practice, this means a strong subject line (which drives opens) does not guarantee strong content (which drives clicks), so you should report both.
open_click_corr = benchmarks['Open_Rate_Pct'].corr(benchmarks['Click_Rate_Pct'])
round(open_click_corr, 3)
Part 8: Visualizing the Real Weak Relationship#
A scatter plot shows the relationship behind a correlation number, including any outliers that drive it. The code plots open rate on the x-axis against click rate on the y-axis with plt.scatter, where s=40 sets the dot size. The image is saved to open_vs_click_scatter.png and closed, so it does not display here. When you open it, look for a loose cloud with no clear upward line, plus a few industries sitting well above the rest on click rate.
plt.figure(figsize=(8, 6))
plt.scatter(benchmarks['Open_Rate_Pct'], benchmarks['Click_Rate_Pct'], color='darkorange', s=40)
plt.xlabel('Real Open Rate (%)')
plt.ylabel('Real Click Rate (%)')
plt.title('Real Open Rate vs Click Rate by Industry')
plt.tight_layout()
plt.savefig('open_vs_click_scatter.png', dpi=120)
plt.close()
Part 9: Real Click-to-Open Rate, The Content Signal#
Click-to-open rate (CTOR) divides clicks by opens, so it measures how persuasive the content is among people who actually read the email. That separates content quality from subject-line appeal. The code sorts by Click_To_Open_Rate_Pct and keeps the top ten. The output shows Manufacturing at 14.82% and Legal at 14.72%, about double the 6.80% average from the summary. Media (12.92%) and Construction (12.38%) follow. These sectors have relatively few openers, but those who open are very likely to click.
top_ctor = benchmarks.sort_values('Click_To_Open_Rate_Pct', ascending=False).head(10)
top_ctor[['Industry', 'Click_To_Open_Rate_Pct']]
Part 10: Real Low Open, High CTOR Industries#
Some industries struggle to get emails opened but convert readers well once they do. Those are good candidates for subject-line improvements. The code calculates the median open rate and median CTOR, then filters rows below the first and above the second, combining both conditions with & and wrapping each in brackets. The output lists 13 industries, including Manufacturing (37.36% opens, 14.82% CTOR) and Travel and transportation (30.10% opens, 6.34% CTOR). Using medians rather than means keeps the thresholds from being pulled by extreme industries.
median_open = benchmarks['Open_Rate_Pct'].median()
median_ctor = benchmarks['Click_To_Open_Rate_Pct'].median()
hidden_gems = benchmarks[(benchmarks['Open_Rate_Pct'] < median_open) & (benchmarks['Click_To_Open_Rate_Pct'] > median_ctor)]
hidden_gems[['Industry', 'Open_Rate_Pct', 'Click_To_Open_Rate_Pct']]
Part 11: Real Unsubscribe Rate Leaders#
Unsubscribes are the cost side of email marketing: each one shrinks your future audience. The code sorts by Unsubscribe_Rate_Pct from highest to lowest. The output shows Photo and video highest at 0.40%, followed by Restaurants and cafes (0.39%) and Telecommunications (0.34%). These numbers look tiny, but 0.40% per send adds up across many campaigns. Interestingly, several high-open industries such as Art gallery and museum and Coaching also appear here.
top_unsub = benchmarks.sort_values('Unsubscribe_Rate_Pct', ascending=False).head(10)
top_unsub[['Industry', 'Unsubscribe_Rate_Pct']]
Part 12: Real Lowest Unsubscribe Rate Industries#
The lowest unsubscribe rates show where audiences are most loyal. Sorting in ascending order puts them first. The output shows Legal lowest at 0.09%, then Higher education and Media at 0.10%. Legal and Media were also near the top for clicks and CTOR, so these sectors combine engaged readers with a stable list. Religion and Travel and transportation tie at 0.13%, which is a reminder that the same industry can be weak on one metric and strong on another.
bottom_unsub = benchmarks.sort_values('Unsubscribe_Rate_Pct').head(10)
bottom_unsub[['Industry', 'Unsubscribe_Rate_Pct']]
Part 13: Real Correlation, Open Rate and Unsubscribe Rate#
You might expect industries with more engaged readers to lose fewer subscribers. The code correlates open rate with unsubscribe rate using .corr(). The output is 0.169, a weak positive relationship, the opposite direction to that intuition. A plausible reading is that more people opening also means more people see the unsubscribe link. Treat that as a hypothesis rather than a conclusion: with only 45 industry averages, a correlation this weak could easily be noise.
open_unsub_corr = benchmarks['Open_Rate_Pct'].corr(benchmarks['Unsubscribe_Rate_Pct'])
round(open_unsub_corr, 3)
Part 14: Real All-Metric Correlation Matrix#
Rather than checking pairs one at a time, a correlation matrix shows every pair at once. Calling .corr() on a DataFrame of the four metric columns returns a square table where each cell is the correlation between a row metric and a column metric, and the diagonal is always 1. The output shows click rate and CTOR are very strongly related at 0.929, while open rate and CTOR are almost unrelated at -0.059. CTOR also has the strongest link with unsubscribes, at -0.267, so better content goes with fewer unsubscribes.
metric_cols = ['Open_Rate_Pct', 'Click_Rate_Pct', 'Click_To_Open_Rate_Pct', 'Unsubscribe_Rate_Pct']
correlation_matrix = benchmarks[metric_cols].corr().round(3)
correlation_matrix
Part 15: Real Overall Industry Benchmark#
An overall benchmark gives you a single reference point when the exact industry is unclear. The code takes the median of open rate and click rate across all 45 industries and rounds to two decimals. The output is 43.75% for opens and 1.83% for clicks. The median is preferred to the mean here because it is not pulled by a few extreme industries; for click rate, the mean of 2.09% is noticeably higher than the median, showing a few high-clicking sectors lift the average.
overall_open = round(benchmarks['Open_Rate_Pct'].median(), 2)
overall_click = round(benchmarks['Click_Rate_Pct'].median(), 2)
overall_open, overall_click
Part 16: Real Campaign Benchmarking Function#
Wrapping a repeated comparison in a function saves time and avoids copy-paste errors. benchmark_campaign filters the row for the chosen industry, uses .iloc[0] to take the first match as a single row, and returns the difference between your rates and the benchmark. The test with an e-commerce campaign at 35.0% opens and 1.5% clicks returns +2.33 points on opens and +0.43 on clicks. So a 35% open rate, which sounds average overall, actually beats the e-commerce benchmark.
def benchmark_campaign(industry_name, my_open_rate, my_click_rate):
row = benchmarks[benchmarks['Industry'] == industry_name].iloc[0]
open_diff = round(my_open_rate - row['Open_Rate_Pct'], 2)
click_diff = round(my_click_rate - row['Click_Rate_Pct'], 2)
return {'open_rate_vs_benchmark': open_diff, 'click_rate_vs_benchmark': click_diff}
benchmark_campaign('e-commerce', 35.0, 1.5)
Part 17: Real Testing the Function on Another Industry#
Testing a function on a second, different case is good practice before trusting it. Here a Non-profit campaign with a 48.0% open rate and 3.5% click rate is compared with its benchmark. The output shows opens 4.38 points below the benchmark but clicks 0.6 points above. A 48% open rate would beat most industries, yet for a non-profit it is underperforming. This is the whole point of benchmarking: the same number means different things in different sectors.
benchmark_campaign('Non-profit', 48.0, 3.5)
Part 18: Real Distribution of Open Rates#
A histogram shows how open rates are spread across industries, which a ranked list cannot do. plt.hist with bins=15 groups the 45 values into 15 ranges, and plt.axvline draws a dashed vertical line at the median of 43.75%, labelled through the f-string and shown with plt.legend(). The figure is saved to open_rate_distribution.png and closed. When you open it, look at whether most industries cluster near the median and whether any sit far out on either side, such as Travel and transportation near 30%.
plt.figure(figsize=(9, 5))
plt.hist(benchmarks['Open_Rate_Pct'], bins=15, color='mediumseagreen', edgecolor='white')
plt.axvline(overall_open, color='crimson', linestyle='--', label=f'Real Median: {overall_open}%')
plt.xlabel('Real Open Rate (%)')
plt.ylabel('Real Number of Industries')
plt.title('Real Distribution of Email Open Rates Across Industries')
plt.legend()
plt.tight_layout()
plt.savefig('open_rate_distribution.png', dpi=120)
plt.close()
Part 19: Real Range Check, Click Rate#
The range, maximum minus minimum, is the simplest measure of spread. The code subtracts the lowest click rate from the highest and rounds. The output is 4.07 percentage points, the gap between Legal at 4.90% and the lowest industry at 0.83%. Relative to a median click rate of 1.83%, that gap is very large, which shows how much click performance depends on the sector. The range is easy to explain but sensitive to a single extreme value.
click_range = round(benchmarks['Click_Rate_Pct'].max() - benchmarks['Click_Rate_Pct'].min(), 2)
click_range
Part 20: Real Industries Above the Overall Median on Every Metric#
Strong all-round performers are the industries to learn from. The code stores the median of each metric, then keeps industries above the median on open rate and click rate and below the median on unsubscribe rate. Note that CTOR is not part of this filter despite the heading. The output lists six industries: Government, Higher education, Non-profit, Other, Public relations and Religion. Many of these send informational rather than sales emails, which may explain their balanced performance.
medians = benchmarks[metric_cols].median()
all_star = benchmarks[(benchmarks['Open_Rate_Pct'] > medians['Open_Rate_Pct']) & (benchmarks['Click_Rate_Pct'] > medians['Click_Rate_Pct']) & (benchmarks['Unsubscribe_Rate_Pct'] < medians['Unsubscribe_Rate_Pct'])]
all_star[['Industry']]
Part 21: Real Worst-Performing Industries Overall#
The opposite filter finds industries below the median on both open rate and click rate. The code returns two things at once: the count with len() and the first ten names using .tolist()[:10]. The output shows 12 struggling industries, of which the first ten are displayed, including e-commerce, Retail, Real estate and Software and web app. Many are commercial, high-frequency senders. Because the list is cut at ten, two names are hidden; remove the slice to see them all.
struggling = benchmarks[(benchmarks['Open_Rate_Pct'] < medians['Open_Rate_Pct']) & (benchmarks['Click_Rate_Pct'] < medians['Click_Rate_Pct'])]
len(struggling), struggling['Industry'].tolist()[:10]
Part 22: Real Ranking by Composite Engagement Score#
A composite score combines several metrics into one number so you can rank everything on a single scale. The code weights open rate by 0.3, click rate by 0.4 and CTOR by 0.3. Click rate is multiplied by 10 first because it is on a much smaller scale; without that, it would barely affect the score. The output ranks Legal top at 36.79, then Media (33.17) and Manufacturing (32.53). The weights are a judgement call, so always state them when you share a composite ranking.
benchmarks['engagement_score'] = (benchmarks['Open_Rate_Pct'] * 0.3 + benchmarks['Click_Rate_Pct'] * 10 * 0.4 + benchmarks['Click_To_Open_Rate_Pct'] * 0.3).round(2)
benchmarks.sort_values('engagement_score', ascending=False)[['Industry', 'engagement_score']].head(10)
Part 23: Real Bottom of the Composite Ranking#
The bottom of the composite ranking shows where email programmes most need attention. Sorting in ascending order puts the lowest scores first. The output shows e-commerce lowest at 15.28, followed by Beauty and personal care (16.49) and Computers and electronics (17.52). Retail and Software and web app are also present, overlapping heavily with the struggling list from before. That consistency across two different methods makes the finding more trustworthy.
benchmarks.sort_values('engagement_score')[['Industry', 'engagement_score']].head(10)
Part 24: Real Legal Industry Deep Dive#
A deep dive on the top performer helps explain why it ranks first. The code selects the Legal row with .iloc[0] and shows only the four metric columns. The output shows a 42.58% open rate, slightly below the 43.75% median, but a 4.9% click rate, a 14.72% CTOR and just a 0.09% unsubscribe rate. Legal wins through content and loyalty rather than opens. The dtype: object line appears because the row mixes text and numbers, which is normal when you pull a single row.
legal_row = benchmarks[benchmarks['Industry'] == 'Legal'].iloc[0]
legal_row[metric_cols]
Part 25: Real Retail vs E-commerce Comparison#
Retail and e-commerce are often lumped together, so a side-by-side comparison is useful. .isin() keeps rows whose Industry matches any value in the list. The output shows Retail ahead on every engagement measure: 37.47% opens versus 32.67%, 1.27% clicks versus 1.07%, and 4.51% CTOR versus 4.01%. e-commerce has the lower unsubscribe rate, 0.18% against 0.22%. If you sell online, use the e-commerce benchmark, not retail, or you will set targets too high.
retail_ecom = benchmarks[benchmarks['Industry'].isin(['Retail', 'e-commerce'])]
retail_ecom[['Industry'] + metric_cols]
Part 26: Saving the Real Ranked Benchmark Table#
Saving the ranked table lets colleagues use it without rerunning the notebook. The code sorts by engagement_score, uses reset_index(drop=True) to replace the old index with a clean 0 to 44 sequence, and saves with index=False so no extra index column is written. It then reloads the file and compares shapes. The output True confirms the file round-trips correctly. Note that the saved file now includes the engagement_score column added earlier.
ranked_benchmarks = benchmarks.sort_values('engagement_score', ascending=False).reset_index(drop=True)
ranked_benchmarks.to_csv('ranked_email_benchmarks.csv', index=False)
reloaded_ranked = pd.read_csv('ranked_email_benchmarks.csv')
reloaded_ranked.shape == ranked_benchmarks.shape
Part 27: Real Sanity Check, Percentages in Range#
Rates should always sit between 0 and 100, and a quick check catches data entry or parsing errors. Each half of the code builds a boolean Series with & and uses all() to confirm every value passes, and Python's and then joins the two True/False results. The output True confirms both open and click rates are valid percentages. Using and is fine here because all() has already reduced each side to a single True or False.
all((0 <= benchmarks['Open_Rate_Pct']) & (benchmarks['Open_Rate_Pct'] <= 100)) and all((0 <= benchmarks['Click_Rate_Pct']) & (benchmarks['Click_Rate_Pct'] <= 100))
Part 28: Real Sanity Check, No Duplicate Industries#
Duplicate rows would double-count an industry and break the benchmarking function, which takes the first match only. .is_unique is a Series property that returns True if no value repeats. The output True confirms each of the 45 industries appears exactly once. This is a quick check worth running on any column you plan to use as a lookup key.
benchmarks['Industry'].is_unique
Part 29: Real Takeaway for a Hypothetical Campaign#
This step shows how the function is used in practice for a real decision. A hypothetical software campaign with 41.0% opens and 1.3% clicks is compared with the Software and web app benchmark. The output shows +1.69 points on opens and +0.15 on clicks, so the campaign beats its industry on both. Against the overall medians of 43.75% and 1.83% it would look weak, which shows why comparing with the right industry is essential.
my_result = benchmark_campaign('Software and web app', 41.0, 1.3)
my_result
Part 30: Real Recap Print#
A recap sentence turns the analysis into a clear headline for a report. The code finds the top industry by sorting on engagement_score and taking the first row with .iloc[0], then builds a sentence with an f-string. The output reads: across 45 industries, the median open rate was 43.75% and the median click rate 1.83%, with Legal posting the strongest composite performance. Using variables rather than typed numbers keeps the summary accurate if the data is updated.
top_industry = benchmarks.sort_values('engagement_score', ascending=False).iloc[0]['Industry']
print(f'Across {len(benchmarks)} real industries, the median open rate was {overall_open}% and median click rate was {overall_click}%, with {top_industry} posting the real strongest composite email performance.')
Wrap-Up: What You Learned#
- Real published industry benchmarks give any marketer an honest yardstick, without one, a raw open or click rate number means very little.
- Open rate and click rate turned out to be only weakly correlated across real industries, confirming they genuinely measure different things.
- Click-to-open rate isolates real content quality specifically, separate from how many people opened the email in the first place.
- A real simple reusable benchmarking function makes comparing any real campaign against its real industry standard fast and repeatable.
- Combining several real metrics into one composite score is a real practical way to rank performance across many real categories at once.
- Next video: real airline customer sentiment analysis, returning to real text analysis with a real single-brand deep dive.
Practice on your own
- Extend
benchmark_campaignso it also takes a CTOR and an unsubscribe rate and returns the difference for all four metrics, then test it on the Legal and Retail benchmarks. - Change the composite score weights, for example 0.2 for opens, 0.5 for clicks and 0.3 for CTOR, and compare the new top ten with the original. Which industries move the most?
- Draw a scatter plot of
Click_Rate_PctagainstUnsubscribe_Rate_Pctand label the five industries with the highest click rate usingplt.annotate.
The next video in the series returns to text analysis with an airline customer sentiment deep dive focused on a single brand.
Found this useful?
All lessons, notebooks and datasets here are free. If they helped you, a coffee keeps new lessons coming.



