top of page

Data Scientist Program


Free Online Data Science Training for Complete Beginners.

No prior coding knowledge required!

Analyzing The Office Series popularity

The Office is a British television series first aired in the UK on BBC Two on 9 July 2001. Written and directed by Ricky Gervais and Stephen Merchant, and produced by Ash Atalla, the programme follows the day-to-day lives of office employees in the Slough branch of the fictional Wernham Hogg paper company.

So, in this blog we are going to have fun by playing with the the office data set provided by the kaggle. We will visualizing some trends from the series ratings and their viewership.

Let's start.

As always using jupyter notebook for visualizing our findings from the Office Series episodes data. The data set can be downloaded from Kaggle. Importing necessary libraries and data-set from kaggle can be done through below code.

import pandas as pd
import matplotlib.pyplot as plot


Viewership of Episodes.

The apparent trend which we have observed is the popularity of the Office series has slightly decreased till the last episode, and some unexpected ratings which was received by ffb

for index,row in data.iterrows():
    if row['Ratings']/10 < 0.25:
    elif ((row['Ratings']/10 >= 0.25) & (row['Ratings']/10 < 0.50)):
    elif ((row['Ratings']/10 >= 0.50) & (row['Ratings']/10 < 0.75)):
    elif row['Ratings']/10 >= 0.75:
size=[250 if pd.notna(data.GuestStars[n]) else 25 for n in range(len(data))]

The above code does set the color for ratings in col list and size list is based on the appearances of guest stars in an episode, sets the marker size.


From the above plot there is no clear evidence of viewership affected by the appearance of guest stars.

Viewership with Seasons.

Now for viewership change with season we will plot the data on bar plot clearly examine the change in viewers interests in The Office Series. For this we will first group the data by Season and then performing sum on viewership and at last plotting bar plot.



The above bar plot shows the viewers interests were at the peak in the fifth season and was the most watched season. After which the viewers interests were steadily decreased, which might be due very long period of the series.


Recent Posts

See All


bottom of page