VISVESVARAYA TECHNOLOGICAL UNIVERSITY
BELAGAVI - 590 018, KARNATAKA.
PROJECT REPORT
on
“ANALYSING SOCIAL MEDIA TRENDS”
Submitted in the partial fulfillment of
requirements for
BIG DATA ANALYTICS (21CS71)
Submitted by
DARSHITHA 4BD21CS034
PROJECT GUIDE
Prof. Shwetha G [Link]
Assistant Professor
Department of CS&E
B.I.E.T., Davanagere
Department of Computer Science and Engineering.
Bapuji Institute of Engineering & Technology
Davangere- 577004
INTRODUCTION
The Analyzing Social Media Trends Project aims to gain insights into social media usage,
engagement patterns, and trends across various platforms. By exploring popular hashtags,
platform-specific behaviors, and user engagement metrics like likes and retweets, this
project helps to identify emerging trends, evaluate the effectiveness of content strategies,
and understand time-based patterns in user activity. Additionally, the analysis includes
visualization techniques to make the insights accessible and actionable, aiding
stakeholders in refining their social media campaigns and improving audience
engagement.
The goal of the Analyzing Social Media Trends Project is to extract insights from social
media data to improve content strategies and boost audience engagement. This involves
identifying popular trends like frequently used hashtags, understanding platform-specific
behaviors, and evaluating post performance across platforms. The project also measures
engagement metrics such as likes and retweets to highlight impactful content and
identifies temporal patterns like peak posting hours to optimize scheduling. Insights are
presented through tools like word clouds and bar charts, making findings intuitive and
actionable.
Libraries and Tools Used
1. Python: The core programming language for data analysis and visualization.
2. Libraries Used:
pandas: For data manipulation, cleaning, and exploratory analysis.
matplotlib: For static plotting and visualizing data trends.
seaborn: To enhance visualizations with aesthetically pleasing and detailed plots.
wordcloud: For creating word cloud visualizations to represent textual data effectively.
3. Google Colab: A collaborative cloud-based environment for writing and executing Python
code.
4. Jupyter Notebooks: Provides an interactive and flexible coding space with support for
inline visualizations.
5. File Management:
Google Colab files Module: Used for uploading and managing datasets within the
cloud environment.
CS&E Dept, B.I.E.T, Davangere 1
6. Dataset: A CSV file containing structured data about social media trends, including features
like hashtags, platforms, likes, retweets, and timestamps.
Implementation Steps
Step 1: Install and Import Required Libraries
Begin by installing the necessary libraries such as pandas, matplotlib, seaborn, and wordcloud.
These tools are essential for data handling, visualization, and text analysis. Import them into
the environment to enable seamless functionality.
Step 2: Upload and Load the Dataset
Upload the social media dataset, and load it using pandas. This provides a structured DataFrame
that allows for efficient manipulation and analysis of the data.
Step 3: Data Cleaning
Clean the dataset by removing unnecessary or redundant columns such as Unnamed: 0 and
Unnamed: 0.1. Fill missing values in critical fields like Hashtags and Platform with appropriate
defaults, such as an empty string or "Unknown," to maintain data consistency.
Step 4: Analyze Popular Hashtags
Extract hashtags from the dataset and calculate their frequency. Use pandas to identify the top
hashtags and visualize their frequency with a bar plot. This highlights the most popular trends
across posts.
Step 5: Analyze Platform Trends:
Examine the distribution of posts across different social media platforms. Use seaborn to create
count plots that showcase platform-specific activity. This helps in understanding which
platforms are the most active and engaging.
Step 6: Engagement Analysis
Sort posts by likes to identify the top-performing content. Create bar charts to visualize posts
with the highest likes and retweets, if applicable, to pinpoint what content resonates most with
users.
Step 7: Time-Based Trends
If the dataset includes timestamps, analyze patterns of user activity by hours and months. Use
count plots to explore how user engagement varies over time and optimize content posting
strategies accordingly.
CS&E Dept, B.I.E.T, Davangere 2
Step 8: Create Word Cloud of Post Content
Generate a word cloud using the WordCloud library to visualize the most frequently used words
in post content. This provides a quick and engaging overview of the dominant topics and
themes.
Step 9: Save Processed Data (Optional)
Save the cleaned and processed dataset to a CSV file for further analysis or use. This ensures
the transformed data is accessible for future applications.
Step 10: Visualize and Interpret Insights
Finally, combine all visualizations and findings to form actionable insights. Present these in
an organized report to inform strategies for better audience engagement and trend adoption.
Code Implementation
# Install Required Libraries
!pip install pandas matplotlib seaborn wordcloud
# Import Necessary Libraries
import pandas as pd
import [Link] as plt
import seaborn as sns
from wordcloud import WordCloud
# Step 1: Upload and Load Dataset
from [Link] import files
uploaded = [Link]()
# Replace '[Link]' with the uploaded filename
df = pd.read_csv('[Link]')
# Step 2: Data Cleaning
df_cleaned = [Link](columns=['Unnamed: 0.1', 'Unnamed: 0'], errors='ignore')
df_cleaned['Hashtags'] = df_cleaned['Hashtags'].fillna('')
df_cleaned['Platform'] = df_cleaned['Platform'].fillna('Unknown')
CS&E Dept, B.I.E.T, Davangere 3
# Step 3: Analyze Popular Hashtags
# Create a list of all hashtags
hashtag_list = df_cleaned['Hashtags'].[Link]().sum()
hashtag_freq = [Link](hashtag_list).value_counts().head(15)
# Plot the top 15 hashtags
[Link](figsize=(10, 5))
[Link](x=hashtag_freq.values, y=hashtag_freq.index, palette='coolwarm')
[Link]('Top 15 Hashtags', fontsize=16)
[Link]('Frequency', fontsize=12)
[Link]('Hashtags', fontsize=12)
[Link]()
# Step 4: Analyze Platform Trends
# Platform distribution
[Link](figsize=(8, 5))
[Link](data=df_cleaned, x='Platform', palette='viridis')
[Link]('Posts by Platform', fontsize=16)
[Link]('Platform', fontsize=12)
[Link]('Count', fontsize=12)
[Link](rotation=45, fontsize=10)
[Link]()
CS&E Dept, B.I.E.T, Davangere 4
# Step 5: Engagement Analysis
# Top posts with the most likes
top_liked = df_cleaned.sort_values(by='Likes', ascending=False).head(10)
[Link](figsize=(10, 5))
[Link](x=top_liked['Likes'], y=top_liked['Text'], palette='mako')
[Link]('Top 10 Posts by Likes', fontsize=16)
[Link]('Likes', fontsize=12)
[Link]('Post Snippets', fontsize=12)
[Link]()
# Top posts with the most retweets (if applicable)
if 'Retweets' in df_cleaned.columns:
top_retweeted = df_cleaned.sort_values(by='Retweets', ascending=False).head(10)
[Link](figsize=(10, 5))
[Link](x=top_retweeted['Retweets'], y=top_retweeted['Text'], palette='rocket')
[Link]('Top 10 Posts by Retweets', fontsize=16)
[Link]('Retweets', fontsize=12)
[Link]('Post Snippets', fontsize=12)
CS&E Dept, B.I.E.T, Davangere 5
[Link]()
# Step 6: Time-Based Trends (if timestamp data is available)
if 'Hour' in df_cleaned.columns:
# Post frequency by hour
[Link](figsize=(10, 5))
[Link](data=df_cleaned, x='Hour', palette='coolwarm')
[Link]('Posts by Hour', fontsize=16)
[Link]('Hour of Day', fontsize=12)
[Link]('Count', fontsize=12)
[Link]()
if 'Month' in df_cleaned.columns:
# Post frequency by month
[Link](figsize=(10, 5))
[Link](data=df_cleaned, x='Month', palette='pastel')
[Link]('Posts by Month', fontsize=16)
[Link]('Month', fontsize=12)
[Link]('Count', fontsize=12)
[Link]()
CS&E Dept, B.I.E.T, Davangere 6
# Step 7: Word Cloud of Post Content
text = ' '.join(df_cleaned['Text'].dropna())
wordcloud = WordCloud(width=800, height=400, background_color='white').generate(text)
[Link](figsize=(10, 5))
[Link](wordcloud, interpolation='bilinear')
[Link]('off')
[Link]('Word Cloud of Post Content', fontsize=16)
[Link]()
CS&E Dept, B.I.E.T, Davangere 7
# Step 8: Save Insights (Optional)
df_cleaned.to_csv('processed_social_media_trends.csv', index=False)
print("Processed dataset saved as 'processed_social_media_trends.csv'")
CS&E Dept, B.I.E.T, Davangere 8