This repository contains a complete analysis of YouTube trending videos from 10 different countries. The project leverages Python and the Pandas library to ingest, clean, and extract statistical insights from large datasets.
The primary objective was to process raw data to understand user engagement patterns, tag trends, and temporal distribution of video uploads.
The project workflow is divided into three main stages:
- Dataset Aggregation: Concatenated multiple CSV files into a single dataframe, introducing a
countrycolumn for geospatial distinction. - Handling Missing Values: Identified and extracted videos containing no tags.
- Filtering: Created a separate
excludeddataframe for videos with:comments_disabledratings_disabledvideo_error_or_removed- Note: These records were removed from the primary analysis to ensure data quality.
- Engagement Metrics: Calculated a
like_ratio(Likes / Dislikes) for each video. - Temporal Parsing: Split the
trending_dateinto distinctYear,Month, andDaycolumns for granular time-series analysis. - Time Clustering: Grouped video publish times into 10-minute intervals (e.g., 02:20 - 02:30) to analyze upload patterns.
- Channel Performance: Calculated total views per channel.
- Tag Analysis:
- Counted total videos per tag.
- Identified the most frequently used tags.
- Computed the average Like/Dislike ratio for each
(tag, country)pair.
- Trend Identification:
- Identified the top-viewed video for each
(trending_date, country)pair. - Identified the top-viewed video for each
(month, country)pair.
- Identified the top-viewed video for each
- Category Mapping: Processed JSON files to map category IDs and quantified unassignable video categories per country.
- Language: Python (Jupyter Notebook)
- Libraries:
pandas: For data manipulation and aggregation.numpy: For numerical operations.json: For parsing category metadata.
- Additional packages needed:
zstd, in order to read zip files in the folders.
- AI tools were only used as a means of support in case of code not running. AI languages did not write any code from scratch and the main support was the pandas documentation available online.
Project developed for the Foundations of Computer Science course.
