WhatsApp Chat ๐ฑ โ Analyze ๐, Visualize ๐
WhatsApp is the most preferred messenger app in the world today and has more than 2B users worldwide. More than 65B messages are sent daily.
In this article, I will present you with interesting analysis and visualization that could be done on any WhatsApp chat.
The full script for this exercise can be obtained here:
Analyzing our own data is so much fun! Believe me!
Getting WhatsApp Chat
WhatsApp has a functionality that enables you to download the conversation logs of individual and group chats.
iPhone: Open chat | Tap on name | Scroll down | Export chat โ Text file
Android: Open chat | Tap more options โฎ | More | Export chat โ Text file
Data Preparation
Chat data is in a semi-structured format. Therefore, we need to convert it into a structured format to enable us to analyze and visualize data in a more interpretable way.Each line in a text file follows a specific format:
[date, time] Author: message
Using RegEx, we will parse the text file and convert it into a pandas dataframe.
Exploratory Data Analysis (EDA)
First, some basic statistics
How many messages have been exchanged?
How many authors are there?
What is the average number of messages exchanged every day?
Analysis 1: Datetime
When was the group most active?
Which day of the week, part of the day, an hour of the day has the most number of messages exchanged?
Analysis 2: Author
Who is the most talkative?
Whose messages are decreasing with time?
Who sends long messages?
Analysis 3: Messages
What are the most commonly used words in the messages (overall, author-wise)?
Analysis 4: Emojis
What are the most commonly used emojis (overall, author-wise)?
What is the emoji-to-message ratio for the author?
Analysis 5: Subject
What is the most common subject of the group?
Analysis 6: Activeness
How many days the group was silent?
Who is the most active author?
Analysis 7: Messages Deleted
Which author has deleted the most number of messages?
Analysis 8: Interactions
Whom the author has replied the most?
Who are the top responders to that author?
Analysis 9: Sentiment
Who is the most positive author?
When was the group or the author most happy?