Data Web Scraping TV Show Sites: Analysis and Exploration

Posted on Nov 21, 2016
The skills the author demoed here can be learned through taking Data Science with Machine Learning bootcamp with NYC Data Science Academy.

Introduction

Television shows are an important part of everyday life. They can be portals to a parallel universe or windows to our wildest dreams. All these different shows give rise to many different review websites, each with its own scoring system and critic reviews. Out of curiosity, let's compare these review websites to see how different their scores are compared to each other. For this project, data from three popular TV show websites was chosen for analysis: The Movie Db, Rotten Tomatoes, and IMDb.

Data Scraping Process

The main tool used in this project is Scrapy. It is a free web crawling framework. The main component of Scrapy is a "spider", which is a web crawler with a series of customizable commands for scraping information from a website. Here is a scraping workflow for this project.

Data Web Scraping TV Show Sites: Analysis and Exploration

From TVDb main page, I obtained a list of TV shows, then using it as a library to scrap show information. The information I scraped for each TV show includes show name, genre, network, show status, and show rating for each of the three websites.

A total of four spiders were implemented in this project: one spider for TVDb , one spider for Rotten Tomatoes, and two for IMDb. IMDb was more difficult to scrape because of its complex url addresses; (each show is encoded as a number rather than its actual name), thus a spider was used to scrape the url of the show. Through the url, another spider was implemented to scrape the attributes of the show. All the spider codes can be find here.

Exploratory Data Visualization

Data Web Scraping TV Show Sites: Analysis and ExplorationData Web Scraping TV Show Sites: Analysis and Exploration

 

The top plot is the overall density distribution of all three website scores. The first important observation we can make is that the overall trend is very similar, all three distributions are skewed to the left, meaning few shows have very low scores. The bottom plot is a violin plot of the three score distributions. Rotten Tomatoes has the highest distribution with a median of 8.4, IMDb is the second highest with a median of 7.5, and followed by TVDb with a median of 6.3. Another interesting observation is that Rotten Tomatoes and TVDb has zero values for TV score, and IMDb does not, this might due to the imputation method used for null values of each website.

To explore deeper into the dataset, I analyzed the following distributions of attributes with potential influence: Status, Network, and Genre.

Status:

Data Web Scraping TV Show Sites: Analysis and Exploration

There are three factors in the status attribute: Cancelled, Ended, Returning Series. From the bar plot, returning series has the highest score compared to cancelled and ended shows. Intuitive, cancelled and ended shows tend to have lower score which ultimately lead to show termination.

Networks:

network-distribution

Top ten network were selected out of 107 different networks. The HBO network has the highest average rating in all three websites, followed by the BBC network.

Genre:

imdb_genre tmt_genretvdb_genre

Although all score distributions exhibit similar behavior, the top genres are different for each distribution. Rotten Tomatoes ranked Talk, News, and Musical as the top three genres scores. IMDb ranked Adventure, Honor, and Crime as the top three scores. TVDb ranked News, Family, and Adventure as the top three. Also note that TVDb has no information on the Talk genre.

From all the exploratory analysis, we can see there is definitely an underlying differences between these three website scoring systems. How do we validate and quantify this difference? Let's perform some statistical analysis to find out!

Statistical Data Analysis

To examine the differences, lets focus only on the score data from the three websites. First, let's investigate any hidden linear relationship between these three scores.pairsplot

From the scatter plot matrix, we can see a very weak linear relationship or collinearity between IMDb and Rotten Tomatoes scores, and no other definite linear relationship can be visualized from the scatter plots.

biplot

Another approach to measure collinearity is through the biplot obtained from PCA. The biplot is composed of the top two principal components, which are orthogonal vectors composed of a linear combination of the three score vectors. From the biplot, the IMDb and Rotten Tomatoes vector points in a similar direction, which again shows that they exhibit some collinearity with each other.

Since both the scatter plot matrix and biplot show that there is a linear relationship, albeit a weak one, are these two score distribution statistically similar, or significant different? A two sample, unequal variance, 95% confidence, two-tail t-test will be able to answer this question.

t-test-resThe p-value is significant smaller than threshold value 0.05, therefore although the two scores might have some degree of collinearity, the test shows that they are in fact significantly different.

Finally, an One-Way ANOVA was performed to test if all three scores are different.

anova

An extremely small p-value indicates that we reject the null hypothesis, therefore the three distributions are in fact significantly different from each other.

 

Conclusion

As observed from both the exploratory and statistical analysis, we can definitely state there is a significant difference in the distribution of scores for these three websites. From the visualization, we can conclude that the scores from Rotten Tomatoes tend to give higher scores than the rest. Also, we saw a weak degree of collinearity between IMDb and Rotten Tomatoes distributions.

However, after performing statistical testing, the t-test concluded that IMDb and Rotten Tomatoes score distributions are significantly different from each other. One-way ANOVA saw that these three distributions are indeed all significantly different. When we compare ratings from different websites, it is pivotal that we compare TV shows on the same scales.

About Author

Alex Yuan Li

Alex Li received his Master of Science in Mechanical Engineering at Columbia University and Bachelor of Science in Chemical Engineering at University of Utah with professional experience in Research and Development in the Medical Device industry. He discovered...
View all posts by Alex Yuan Li >

Related Articles

Leave a Comment

hermes picotin 31 bags Knockoff June 20, 2017
great man, works well on fedora14 hermes picotin 31 bags Knockoff http://www.accessoires-mode.in/hermes-picotin-24-c18_19/
online May 21, 2017
Alo Bali Online Store

View Posts by Categories


Our Recent Popular Posts


View Posts by Tags

#python #trainwithnycdsa 2019 2020 Revenue 3-points agriculture air quality airbnb airline alcohol Alex Baransky algorithm alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus ames dataset ames housing dataset apartment rent API Application artist aws bank loans beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep boston safety Bundles cake recipe California Cancer Research capstone car price Career Career Day citibike classic cars classpass clustering Coding Course Demo Course Report covid 19 credit credit card crime frequency crops D3.js data data analysis Data Analyst data analytics data for tripadvisor reviews data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization database Deep Learning Demo Day Discount disney dplyr drug data e-commerce economy employee employee burnout employer networking environment feature engineering Finance Financial Data Science fitness studio Flask flight delay gbm Get Hired ggplot2 googleVis H20 Hadoop hallmark holiday movie happiness healthcare frauds higgs boson Hiring hiring partner events Hiring Partners hotels housing housing data housing predictions housing price hy-vee Income Industry Experts Injuries Instructor Blog Instructor Interview insurance italki Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter las vegas airport lasso regression Lead Data Scienctist Lead Data Scientist leaflet league linear regression Logistic Regression machine learning Maps market matplotlib Medical Research Meet the team meetup methal health miami beach movie music Napoli NBA netflix Networking neural network Neural networks New Courses NHL nlp NYC NYC Data Science nyc data science academy NYC Open Data nyc property NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time performance phoenix pollutants Portfolio Development precision measurement prediction Prework Programming public safety PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn seafood type Selenium sentiment analysis sentiment classification Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau teachers team team performance TensorFlow Testimonial tf-idf Top Data Science Bootcamp Top manufacturing companies Transfers tweets twitter videos visualization wallstreet wallstreetbets web scraping Weekend Course What to expect whiskey whiskeyadvocate wildfire word cloud word2vec XGBoost yelp youtube trending ZORI