Analysing Political Campaign Ad Spending with Python
- Tanya Sharma
- Jun 12, 2024
- 1 min read
If you're an active user of Facebook or Instagram, you've likely come across election ads from various political parties, particularly the BJP and INC. These parties in India spend substantial amounts on their election campaigns. Recently, I collected data from Meta ads to analyse the spending on Instagram and Facebook ads by different political parties during the 2024 Indian elections in various states. This article explores the analysis of political ad spending using Python and its impact on voter turnout.

Overview of the Campaign Ad Spending Data
The dataset used for this analysis comprises three main files:
Ad Campaign Dataset: Shows which pages (parties or organisations) spend money on election ads and the volume of ads they run.
Regional Spend Dataset: Details the expenditure on ads in different regions, indicating where the campaigns were focused.
Election Results Dataset: Contains actual voting data, including voter numbers and turnout percentages in each region.
You can download the dataset from - https://drive.google.com/drive/folders/1C8rcRkFCBFjwew_2UhqZp1CogKoqC0sw?usp=sharing.
Analysing Ad Spending with Python
Let's begin by importing the necessary Python libraries and loading the dataset:



















Comments